|
|
@@ -23,6 +23,7 @@ Future<void> _pumpGrid(
|
|
|
WidgetTester tester, {
|
|
|
required Size size,
|
|
|
required bool compact,
|
|
|
+ int count = 16,
|
|
|
}) async {
|
|
|
await tester.pumpWidget(
|
|
|
MaterialApp(
|
|
|
@@ -32,7 +33,7 @@ Future<void> _pumpGrid(
|
|
|
child: SizedBox(
|
|
|
width: size.width,
|
|
|
height: size.height,
|
|
|
- child: ShortcutGrid(shortcuts: _specs(16), compact: compact),
|
|
|
+ child: ShortcutGrid(shortcuts: _specs(count), compact: compact),
|
|
|
),
|
|
|
),
|
|
|
),
|
|
|
@@ -73,4 +74,21 @@ void main() {
|
|
|
expect(first.size, lessThanOrEqualTo(168));
|
|
|
expect(first.size, greaterThan(64));
|
|
|
});
|
|
|
+
|
|
|
+ testWidgets('a short grid is anchored to the bottom edge', (tester) async {
|
|
|
+ await _pumpGrid(
|
|
|
+ tester,
|
|
|
+ size: const Size(600, 400),
|
|
|
+ compact: false,
|
|
|
+ count: 4,
|
|
|
+ );
|
|
|
+
|
|
|
+ expect(tester.takeException(), isNull);
|
|
|
+ final grid = tester.getRect(find.byType(ShortcutGrid));
|
|
|
+ final wrap = tester.getRect(find.byType(Wrap));
|
|
|
+ final last = tester.getRect(find.byType(ShortcutTile).last);
|
|
|
+
|
|
|
+ expect(last.bottom, moreOrLessEquals(grid.bottom, epsilon: 0.5));
|
|
|
+ expect(wrap.center.dx, moreOrLessEquals(grid.center.dx, epsilon: 0.5));
|
|
|
+ });
|
|
|
}
|