From 8943c7eb189a59de6f110503a36f8007eb34f8c7 Mon Sep 17 00:00:00 2001 From: Matthias Ngeo Date: Fri, 30 Aug 2024 09:39:22 +0800 Subject: [PATCH] Fix popover test --- .../widgets/popover/popover_golden_test.dart | 42 +++++++++---------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/forui/test/src/widgets/popover/popover_golden_test.dart b/forui/test/src/widgets/popover/popover_golden_test.dart index 5d8d96ebc..39a7c9315 100644 --- a/forui/test/src/widgets/popover/popover_golden_test.dart +++ b/forui/test/src/widgets/popover/popover_golden_test.dart @@ -17,17 +17,15 @@ void main() { final controller = FPopoverController(vsync: const TestVSync()); await tester.pumpWidget( - MaterialApp( - home: TestScaffold( - data: theme, - child: FPopover( - controller: controller, - followerBuilder: (context, style, _) => const SizedBox.square(dimension: 100), - target: const ColoredBox( - color: Colors.yellow, - child: SizedBox.square( - dimension: 100, - ), + TestScaffold( + data: theme, + child: FPopover( + controller: controller, + followerBuilder: (context, style, _) => const SizedBox.square(dimension: 100), + target: const ColoredBox( + color: Colors.yellow, + child: SizedBox.square( + dimension: 100, ), ), ), @@ -41,17 +39,15 @@ void main() { final controller = FPopoverController(vsync: const TestVSync()); await tester.pumpWidget( - MaterialApp( - home: TestScaffold( - data: theme, - child: FPopover( - controller: controller, - followerBuilder: (context, style, _) => const SizedBox.square(dimension: 100), - target: const ColoredBox( - color: Colors.yellow, - child: SizedBox.square( - dimension: 100, - ), + TestScaffold( + data: theme, + child: FPopover( + controller: controller, + followerBuilder: (context, style, _) => const SizedBox.square(dimension: 100), + target: const ColoredBox( + color: Colors.yellow, + child: SizedBox.square( + dimension: 100, ), ), ), @@ -61,7 +57,7 @@ void main() { unawaited(controller.show()); await tester.pumpAndSettle(); - await expectLater(find.byType(MaterialApp), matchesGoldenFile('popover/$name-shown.png')); + await expectLater(find.byType(TestScaffold), matchesGoldenFile('popover/$name-shown.png')); }); }); }