diff --git a/lib/src/components/top_app_bar/top_app_bar.dart b/lib/src/components/top_app_bar/top_app_bar.dart index 4a04f9aa..86ff8a10 100644 --- a/lib/src/components/top_app_bar/top_app_bar.dart +++ b/lib/src/components/top_app_bar/top_app_bar.dart @@ -155,6 +155,7 @@ class ZetaTopAppBar extends ZetaStatefulWidget implements PreferredSizeWidget { /// The semantic label for the microphone icon. final String? microphoneSemanticLabel; + /// The semantic label for the search icon. final String? searchSemanticLabel; /// The semantic label for the back icon when search is open. @@ -176,7 +177,11 @@ class ZetaTopAppBar extends ZetaStatefulWidget implements PreferredSizeWidget { ..add(DiagnosticsProperty('searchController', searchController)) ..add(StringProperty('searchHintText', searchHintText)) ..add(EnumProperty('type', type)) - ..add(DiagnosticsProperty('shrinks', shrinks)); + ..add(DiagnosticsProperty('shrinks', shrinks)) + ..add(StringProperty('clearSemanticLabel', clearSemanticLabel)) + ..add(StringProperty('microphoneSemanticLabel', microphoneSemanticLabel)) + ..add(StringProperty('searchSemanticLabel', searchSemanticLabel)) + ..add(StringProperty('searchBackSemanticLabel', searchBackSemanticLabel)); } } @@ -192,7 +197,7 @@ class _ZetaTopAppBarState extends State { super.initState(); } - Widget _getTitleText(ZetaColors colors) { + Widget _getTitle(ZetaColors colors) { Widget? title = widget.title; if (widget.title is Row) { final oldRow = widget.title! as Row; @@ -279,9 +284,10 @@ class _ZetaTopAppBarState extends State { @override Widget build(BuildContext context) { final colors = Zeta.of(context).colors; + final spacing = Zeta.of(context).spacing; final actions = _getActions(colors); - final titleText = _getTitleText(colors); + final titleText = _getTitle(colors); final title = widget.searchController != null ? ZetaTopAppBarSearchField( @@ -321,24 +327,23 @@ class _ZetaTopAppBarState extends State { return ZetaRoundedScope( rounded: context.rounded, - child: ColoredBox( - color: colors.surfacePrimary, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: Zeta.of(context).spacing.minimum), - child: AppBar( - elevation: 0, - scrolledUnderElevation: 0, - iconTheme: IconThemeData(color: colors.iconDefault), - leading: leading, - automaticallyImplyLeading: widget.automaticallyImplyLeading, - surfaceTintColor: Colors.transparent, - centerTitle: widget.type == ZetaTopAppBarType.centered, - titleTextStyle: widget.titleTextStyle == null - ? ZetaTextStyles.bodyLarge.copyWith(color: colors.textDefault) - : widget.titleTextStyle!.copyWith(color: colors.textDefault), - title: title, - actions: actions, - ), + child: Padding( + padding: EdgeInsets.symmetric(horizontal: spacing.minimum), + child: AppBar( + elevation: 0, + scrolledUnderElevation: 0, + backgroundColor: colors.surfacePrimary, + iconTheme: IconThemeData(color: colors.iconDefault), + leading: leading, + toolbarHeight: spacing.xl_9, + automaticallyImplyLeading: widget.automaticallyImplyLeading, + surfaceTintColor: Colors.transparent, + centerTitle: widget.type == ZetaTopAppBarType.centered, + titleTextStyle: widget.titleTextStyle == null + ? ZetaTextStyles.bodyLarge.copyWith(color: colors.textDefault) + : widget.titleTextStyle!.copyWith(color: colors.textDefault), + title: title, + actions: actions, ), ), ); diff --git a/test/src/components/avatar/avatar_test.dart b/test/src/components/avatar/avatar_test.dart index 7e02d661..10ab2880 100644 --- a/test/src/components/avatar/avatar_test.dart +++ b/test/src/components/avatar/avatar_test.dart @@ -322,7 +322,6 @@ void main() { ZetaAvatar( size: size, ), - ZetaAvatar, 'avatar_default_${size.toString().split('.').last}', ); goldenTest( @@ -331,7 +330,6 @@ void main() { initials: 'AB', size: size, ), - ZetaAvatar, 'avatar_initials_${size.toString().split('.').last}', ); goldenTest( @@ -340,7 +338,6 @@ void main() { image: Image.file(File('/assets/maxresdefault.jpg')), size: size, ), - ZetaAvatar, 'avatar_image_${size.toString().split('.').last}', ); goldenTest( @@ -349,7 +346,6 @@ void main() { name: 'John Doe', size: size, ), - ZetaAvatar, 'avatar_from_name_${size.toString().split('.').last}', ); goldenTest( @@ -358,7 +354,6 @@ void main() { upperBadge: const ZetaAvatarBadge.notification(value: 3), size: size, ), - ZetaAvatar, 'avatar_upper_badge_${size.toString().split('.').last}', ); goldenTest( @@ -367,7 +362,6 @@ void main() { lowerBadge: const ZetaAvatarBadge.icon(icon: Icons.star), size: size, ), - ZetaAvatar, 'avatar_lower_badge_${size.toString().split('.').last}', ); } diff --git a/test/src/components/badge/indicator_test.dart b/test/src/components/badge/indicator_test.dart index 12f768e5..43c683a8 100644 --- a/test/src/components/badge/indicator_test.dart +++ b/test/src/components/badge/indicator_test.dart @@ -157,8 +157,8 @@ void main() { group('Styling Tests', () {}); group('Interaction Tests', () {}); group('Golden Tests', () { - goldenTest(goldenFile, const ZetaIndicator(), ZetaIndicator, 'indicator_default'); - goldenTest(goldenFile, const ZetaIndicator.icon(), ZetaIndicator, 'indicator_icon_default'); + goldenTest(goldenFile, const ZetaIndicator(), 'indicator_default'); + goldenTest(goldenFile, const ZetaIndicator.icon(), 'indicator_icon_default'); goldenTest( goldenFile, const ZetaIndicator.icon( @@ -167,10 +167,9 @@ void main() { inverse: true, size: ZetaWidgetSize.medium, ), - ZetaIndicator, 'indicator_icon_values', ); - goldenTest(goldenFile, const ZetaIndicator.notification(), ZetaIndicator, 'indicator_notification_default'); + goldenTest(goldenFile, const ZetaIndicator.notification(), 'indicator_notification_default'); goldenTest( goldenFile, const ZetaIndicator.notification( @@ -180,7 +179,6 @@ void main() { size: ZetaWidgetSize.small, value: 1, ), - ZetaIndicator, 'indicator_notification_values', ); }); diff --git a/test/src/components/badge/label_test.dart b/test/src/components/badge/label_test.dart index ee6fa91e..24d1e99b 100644 --- a/test/src/components/badge/label_test.dart +++ b/test/src/components/badge/label_test.dart @@ -104,33 +104,29 @@ void main() { group('Styling Tests', () {}); group('Interaction Tests', () {}); group('Golden Tests', () { - goldenTest(goldenFile, const ZetaLabel(label: 'Test Label'), ZetaLabel, 'label_default'); + goldenTest(goldenFile, const ZetaLabel(label: 'Test Label'), 'label_default'); goldenTest( goldenFile, const ZetaLabel(label: 'Test Label', status: ZetaWidgetStatus.positive), - ZetaLabel, 'label_positive', ); goldenTest( goldenFile, const ZetaLabel(label: 'Test Label', status: ZetaWidgetStatus.warning), - ZetaLabel, 'label_warning', ); goldenTest( goldenFile, const ZetaLabel(label: 'Test Label', status: ZetaWidgetStatus.negative), - ZetaLabel, 'label_negative', ); goldenTest( goldenFile, const ZetaLabel(label: 'Test Label', status: ZetaWidgetStatus.neutral), - ZetaLabel, 'label_neutral', ); - goldenTest(goldenFile, const ZetaLabel(label: 'Test Label'), ZetaLabel, 'label_dark', themeMode: ThemeMode.dark); - goldenTest(goldenFile, const ZetaLabel(label: 'Test Label', rounded: false), ZetaLabel, 'label_sharp'); + goldenTest(goldenFile, const ZetaLabel(label: 'Test Label'), 'label_dark', themeMode: ThemeMode.dark); + goldenTest(goldenFile, const ZetaLabel(label: 'Test Label', rounded: false), 'label_sharp'); }); group('Performance Tests', () {}); } diff --git a/test/src/components/badge/priority_pill_test.dart b/test/src/components/badge/priority_pill_test.dart index 0c4b281f..92c120bb 100644 --- a/test/src/components/badge/priority_pill_test.dart +++ b/test/src/components/badge/priority_pill_test.dart @@ -121,7 +121,7 @@ void main() { group('Styling Tests', () {}); group('Interaction Tests', () {}); group('Golden Tests', () { - goldenTest(goldenFile, const ZetaPriorityPill(), ZetaPriorityPill, 'priority_pill_default'); + goldenTest(goldenFile, const ZetaPriorityPill(), 'priority_pill_default'); goldenTest( goldenFile, const ZetaPriorityPill( @@ -131,7 +131,6 @@ void main() { rounded: false, size: ZetaPriorityPillSize.small, ), - ZetaPriorityPill, 'priority_pill_high', ); goldenTest( @@ -140,7 +139,6 @@ void main() { type: ZetaPriorityPillType.medium, isBadge: true, ), - ZetaPriorityPill, 'priority_pill_medium', ); goldenTest( @@ -150,7 +148,6 @@ void main() { size: ZetaPriorityPillSize.small, isBadge: true, ), - ZetaPriorityPill, 'priority_pill_low', ); }); diff --git a/test/src/components/badge/status_label_test.dart b/test/src/components/badge/status_label_test.dart index 2198a529..992f6bad 100644 --- a/test/src/components/badge/status_label_test.dart +++ b/test/src/components/badge/status_label_test.dart @@ -57,14 +57,13 @@ void main() { group('Styling Tests', () {}); group('Interaction Tests', () {}); group('Golden Tests', () { - goldenTest(goldenFile, const ZetaStatusLabel(label: 'Test Label'), ZetaStatusLabel, 'status_label_default'); + goldenTest(goldenFile, const ZetaStatusLabel(label: 'Test Label'), 'status_label_default'); goldenTest( goldenFile, const ZetaStatusLabel( label: 'Custom Icon', customIcon: Icons.person, ), - ZetaStatusLabel, 'status_label_custom', ); }); diff --git a/test/src/components/badge/tag_test.dart b/test/src/components/badge/tag_test.dart index c7990a11..dc1cdba5 100644 --- a/test/src/components/badge/tag_test.dart +++ b/test/src/components/badge/tag_test.dart @@ -50,8 +50,8 @@ void main() { group('Styling Tests', () {}); group('Interaction Tests', () {}); group('Golden Tests', () { - goldenTest(goldenFile, const ZetaTag.right(label: 'Tag', rounded: false), ZetaTag, 'tag_right'); - goldenTest(goldenFile, const ZetaTag.left(label: 'Tag', rounded: true), ZetaTag, 'tag_left'); + goldenTest(goldenFile, const ZetaTag.right(label: 'Tag', rounded: false), 'tag_right'); + goldenTest(goldenFile, const ZetaTag.left(label: 'Tag', rounded: true), 'tag_left'); }); group('Performance Tests', () {}); } diff --git a/test/src/components/banner/banner_test.dart b/test/src/components/banner/banner_test.dart index 44d69c56..a221f5fb 100644 --- a/test/src/components/banner/banner_test.dart +++ b/test/src/components/banner/banner_test.dart @@ -347,8 +347,8 @@ void main() { ); }, ), - ZetaBanner, 'banner_${type.toString().split('.').last}', + widgetType: ZetaBanner, ); } }); diff --git a/test/src/components/button/button_test.dart b/test/src/components/button/button_test.dart index fb72ec0e..140d7537 100644 --- a/test/src/components/button/button_test.dart +++ b/test/src/components/button/button_test.dart @@ -258,47 +258,44 @@ void main() { }); group('Golden Tests', () { - goldenTest(goldenFile, ZetaButton.primary(onPressed: () {}, label: 'Test Button'), ZetaButton, 'button_primary'); + goldenTest( + goldenFile, + ZetaButton.primary(onPressed: () {}, label: 'Test Button'), + 'button_primary', + ); goldenTest( goldenFile, ZetaButton.secondary(onPressed: () {}, label: 'Test Button', leadingIcon: Icons.abc, size: ZetaWidgetSize.small), - ZetaButton, 'button_secondary', ); goldenTest( goldenFile, ZetaButton.positive(onPressed: () {}, label: 'Test Button', trailingIcon: Icons.abc), - ZetaButton, 'button_positive', ); goldenTest( goldenFile, ZetaButton.negative(onPressed: () {}, label: 'Test Button', size: ZetaWidgetSize.small), - ZetaButton, 'button_negative', ); goldenTest( goldenFile, ZetaButton.outline(onPressed: () {}, label: 'Test Button', size: ZetaWidgetSize.large), - ZetaButton, 'button_outline', ); goldenTest( goldenFile, const ZetaButton.outlineSubtle(label: 'Test Button', borderType: ZetaWidgetBorder.sharp), - ZetaButton, 'button_outline_subtle', ); goldenTest( goldenFile, ZetaButton.text(onPressed: () {}, label: 'Test Button', borderType: ZetaWidgetBorder.full), - ZetaButton, 'button_text', ); goldenTest( goldenFile, const ZetaButton.text(label: 'Test Button', borderType: ZetaWidgetBorder.full), - ZetaButton, 'button_disabled', ); }); diff --git a/test/src/components/chat_item/chat_item_test.dart b/test/src/components/chat_item/chat_item_test.dart index e72a00bf..88475d70 100644 --- a/test/src/components/chat_item/chat_item_test.dart +++ b/test/src/components/chat_item/chat_item_test.dart @@ -518,7 +518,7 @@ void main() { const subtitle = Text('Hello, how are you?'); final time = DateTime.now(); - goldenTestWithCallbacks( + goldenTest( goldenFile, Scaffold( body: Column( @@ -544,15 +544,15 @@ void main() { ], ), ), - ZetaChatItem, 'chat_item_default', - before: (tester) async { + widgetType: ZetaChatItem, + setUp: (tester) async { tester.view.devicePixelRatio = 1.0; tester.view.physicalSize = const Size(481, 480); }, ); - goldenTestWithCallbacks( + goldenTest( goldenFile, Column( children: [ @@ -578,15 +578,15 @@ void main() { ), ], ), - ZetaChatItem, 'chat_item_highlighted', - before: (tester) async { + widgetType: ZetaChatItem, + setUp: (tester) async { tester.view.devicePixelRatio = 1.0; tester.view.physicalSize = const Size(481, 480); }, ); - goldenTestWithCallbacks( + goldenTest( goldenFile, Column( children: [ @@ -604,20 +604,20 @@ void main() { ), ], ), - ZetaChatItem, 'chat_item_slidable_actions', - before: (tester) async { + widgetType: ZetaChatItem, + setUp: (tester) async { tester.view.devicePixelRatio = 1.0; tester.view.physicalSize = const Size(481, 480); }, - after: (tester) async { + beforeComparison: (tester) async { final chatItemFinder = find.byType(ZetaChatItem); await tester.drag(chatItemFinder, const Offset(-200, 0)); await tester.pumpAndSettle(); }, ); - goldenTestWithCallbacks( + goldenTest( goldenFile, Column( children: [ @@ -644,20 +644,20 @@ void main() { ), ], ), - ZetaChatItem, 'chat_item_pale_slidable_buttons', - before: (tester) async { + widgetType: ZetaChatItem, + setUp: (tester) async { tester.view.devicePixelRatio = 1.0; tester.view.physicalSize = const Size(481, 480); }, - after: (tester) async { + beforeComparison: (tester) async { final chatItemFinder = find.byType(ZetaChatItem); await tester.drag(chatItemFinder, const Offset(-200, 0)); await tester.pumpAndSettle(); }, ); - goldenTestWithCallbacks( + goldenTest( goldenFile, Column( children: [ @@ -689,20 +689,20 @@ void main() { ), ], ), - ZetaChatItem, 'chat_item_pale_and_regular_buttons', - before: (tester) async { + widgetType: ZetaChatItem, + setUp: (tester) async { tester.view.devicePixelRatio = 1.0; tester.view.physicalSize = const Size(481, 480); }, - after: (tester) async { + beforeComparison: (tester) async { final chatItemFinder = find.byType(ZetaChatItem); await tester.drag(chatItemFinder, const Offset(-200, 0)); await tester.pumpAndSettle(); }, ); - goldenTestWithCallbacks( + goldenTest( goldenFile, Column( children: [ @@ -724,15 +724,15 @@ void main() { ), ], ), - ZetaChatItem, 'chat_item_custom_leading', - before: (tester) async { + widgetType: ZetaChatItem, + setUp: (tester) async { tester.view.devicePixelRatio = 1.0; tester.view.physicalSize = const Size(481, 480); }, ); - goldenTestWithCallbacks( + goldenTest( goldenFile, Column( children: [ @@ -756,20 +756,20 @@ void main() { ), ], ), - ZetaChatItem, 'chat_item_custom_slidable_buttons', - before: (tester) async { + widgetType: ZetaChatItem, + setUp: (tester) async { tester.view.devicePixelRatio = 1.0; tester.view.physicalSize = const Size(481, 480); }, - after: (tester) async { + beforeComparison: (tester) async { final chatItemFinder = find.byType(ZetaChatItem); await tester.drag(chatItemFinder, const Offset(-200, 0)); await tester.pumpAndSettle(); }, ); - goldenTestWithCallbacks( + goldenTest( goldenFile, Column( children: [ @@ -788,13 +788,13 @@ void main() { ), ], ), - ZetaChatItem, 'chat_item_small_screen_slidable_button', - before: (tester) async { + widgetType: ZetaChatItem, + setUp: (tester) async { tester.view.devicePixelRatio = 1.0; tester.view.physicalSize = const Size(315, 480); }, - after: (tester) async { + beforeComparison: (tester) async { final chatItemFinder = find.byType(ZetaChatItem); await tester.drag(chatItemFinder, const Offset(-200, 0)); await tester.pumpAndSettle(); diff --git a/test/src/components/checkbox/checkbox_test.dart b/test/src/components/checkbox/checkbox_test.dart index b718cef9..f0b6c598 100644 --- a/test/src/components/checkbox/checkbox_test.dart +++ b/test/src/components/checkbox/checkbox_test.dart @@ -139,14 +139,13 @@ void main() { }); }); group('Golden Tests', () { - goldenTestWithCallbacks( + goldenTest( goldenFile, ZetaCheckbox( onChanged: (value) {}, ), - ZetaCheckbox, 'checkbox_hover', - after: (tester) async { + beforeComparison: (tester) async { final checkboxFinder = find.byType(ZetaCheckbox); // Hover state @@ -165,7 +164,6 @@ void main() { value: true, onChanged: print, ), - ZetaCheckbox, 'checkbox_enabled', ); @@ -174,7 +172,6 @@ void main() { ZetaCheckbox( value: true, ), - ZetaCheckbox, 'checkbox_disabled', ); }); diff --git a/test/src/components/comms_button/comms_button_test.dart b/test/src/components/comms_button/comms_button_test.dart index 2ff9c648..539792c0 100644 --- a/test/src/components/comms_button/comms_button_test.dart +++ b/test/src/components/comms_button/comms_button_test.dart @@ -217,7 +217,6 @@ void main() { icon: ZetaIcons.phone, type: type, ), - ZetaCommsButton, 'CommsButton_${type.name}', ); } diff --git a/test/src/components/dialpad/dialpad_test.dart b/test/src/components/dialpad/dialpad_test.dart index b4f5cc7e..37575292 100644 --- a/test/src/components/dialpad/dialpad_test.dart +++ b/test/src/components/dialpad/dialpad_test.dart @@ -287,21 +287,18 @@ void main() { onNumber: print, onText: print, ), - ZetaDialPad, 'dialpad_enabled', screenSize: const Size(1000, 1000), ); goldenTest( goldenFile, const ZetaDialPad(), - ZetaDialPad, 'dialpad_disabled', screenSize: const Size(1000, 1000), ); goldenTest( goldenFile, const ZetaDialPadButton(primary: '1'), - ZetaDialPadButton, 'dialpadbutton', screenSize: const Size(1000, 1000), ); diff --git a/test/src/components/fab/fab_test.dart b/test/src/components/fab/fab_test.dart index 2820f8ef..636f8b80 100644 --- a/test/src/components/fab/fab_test.dart +++ b/test/src/components/fab/fab_test.dart @@ -211,15 +211,13 @@ void main() { label: 'Label', onPressed: () {}, ), - ZetaFAB, 'FAB_default', ); - goldenTestWithCallbacks( + goldenTest( goldenFile, ZetaFAB(scrollController: ScrollController(), label: 'Label', onPressed: () => {}), - ZetaFAB, 'FAB_pressed', - after: (tester) async { + beforeComparison: (tester) async { await tester.press(find.byType(ZetaFAB)); await tester.pumpAndSettle(); }, @@ -233,15 +231,13 @@ void main() { shape: ZetaWidgetBorder.rounded, size: ZetaFabSize.large, ), - ZetaFAB, 'FAB_inverse', ); - goldenTestWithCallbacks( + goldenTest( goldenFile, ZetaFAB(scrollController: ScrollController(), label: 'Label', onPressed: () => {}), - ZetaFAB, 'FAB_pressed', - after: (tester) async { + beforeComparison: (tester) async { await tester.press(find.byType(ZetaFAB)); await tester.pumpAndSettle(); }, @@ -255,13 +251,11 @@ void main() { type: ZetaFabType.secondary, shape: ZetaWidgetBorder.sharp, ), - ZetaFAB, 'FAB_secondary', ); goldenTest( goldenFile, ZetaFAB(scrollController: ScrollController(), label: 'Disabled'), - ZetaFAB, 'FAB_disabled', ); }); diff --git a/test/src/components/in_page_banner/in_page_banner_test.dart b/test/src/components/in_page_banner/in_page_banner_test.dart index f29bffed..8d840214 100644 --- a/test/src/components/in_page_banner/in_page_banner_test.dart +++ b/test/src/components/in_page_banner/in_page_banner_test.dart @@ -145,19 +145,16 @@ void main() { goldenTest( goldenFile, const ZetaInPageBanner(content: Text('Test'), title: 'Title'), - ZetaInPageBanner, 'in_page_banner_default', ); goldenTest( goldenFile, ZetaInPageBanner(content: const Text('Test'), onClose: () {}, status: ZetaWidgetStatus.negative), - ZetaInPageBanner, 'in_page_banner_negative', ); goldenTest( goldenFile, const ZetaInPageBanner(content: Text('Test'), status: ZetaWidgetStatus.positive), - ZetaInPageBanner, 'in_page_banner_positive', ); goldenTest( @@ -172,7 +169,6 @@ void main() { ), ], ), - ZetaInPageBanner, 'in_page_banner_buttons', ); }); diff --git a/test/src/components/password/password_input_test.dart b/test/src/components/password/password_input_test.dart index c67a7ad6..d31f0479 100644 --- a/test/src/components/password/password_input_test.dart +++ b/test/src/components/password/password_input_test.dart @@ -90,9 +90,9 @@ void main() { group('Styling Tests', () {}); group('Interaction Tests', () {}); group('Golden Tests', () { - goldenTest(goldenFile, ZetaPasswordInput(), ZetaPasswordInput, 'password_default'); + goldenTest(goldenFile, ZetaPasswordInput(), 'password_default'); final formKey = GlobalKey(); - goldenTestWithCallbacks( + goldenTest( goldenFile, Form( key: formKey, @@ -106,9 +106,8 @@ void main() { rounded: false, ), ), - ZetaPasswordInput, 'password_error', - after: (tester) async { + beforeComparison: (tester) async { formKey.currentState?.validate(); await tester.pump(); }, diff --git a/test/src/components/search_bar/search_bar_test.dart b/test/src/components/search_bar/search_bar_test.dart index 42e1ed7b..6869471a 100644 --- a/test/src/components/search_bar/search_bar_test.dart +++ b/test/src/components/search_bar/search_bar_test.dart @@ -219,14 +219,13 @@ void main() { }); }); group('Golden Tests', () { - goldenTest(goldenFile, ZetaSearchBar(), ZetaSearchBar, 'search_bar_default'); - goldenTest(goldenFile, ZetaSearchBar(), ZetaSearchBar, 'search_bar_medium'); + goldenTest(goldenFile, ZetaSearchBar(), 'search_bar_default'); + goldenTest(goldenFile, ZetaSearchBar(), 'search_bar_medium'); goldenTest( goldenFile, ZetaSearchBar( size: ZetaWidgetSize.small, ), - ZetaSearchBar, 'search_bar_small', ); goldenTest( @@ -234,7 +233,6 @@ void main() { ZetaSearchBar( shape: ZetaWidgetBorder.full, ), - ZetaSearchBar, 'search_bar_full', ); goldenTest( @@ -242,7 +240,6 @@ void main() { ZetaSearchBar( shape: ZetaWidgetBorder.sharp, ), - ZetaSearchBar, 'search_bar_sharp', ); }); diff --git a/test/src/components/tooltip/tooltip_test.dart b/test/src/components/tooltip/tooltip_test.dart index ef2e6efc..31453509 100644 --- a/test/src/components/tooltip/tooltip_test.dart +++ b/test/src/components/tooltip/tooltip_test.dart @@ -204,8 +204,8 @@ void main() { child: Text('Tooltip up'), ), ), - ZetaTooltip, 'arrow_up', + widgetType: ZetaTooltip, ); goldenTest( goldenFile, @@ -214,8 +214,8 @@ void main() { child: Text('Tooltip down'), ), ), - ZetaTooltip, 'arrow_down', + widgetType: ZetaTooltip, ); goldenTest( goldenFile, @@ -225,8 +225,8 @@ void main() { child: Text('Tooltip left'), ), ), - ZetaTooltip, 'arrow_left', + widgetType: ZetaTooltip, ); goldenTest( goldenFile, @@ -236,8 +236,8 @@ void main() { child: Text('Tooltip right'), ), ), - ZetaTooltip, 'arrow_right', + widgetType: ZetaTooltip, ); }); group('Performance Tests', () {}); diff --git a/test/src/components/top_app_bar/extended_top_app_bar_test.dart b/test/src/components/top_app_bar/extended_top_app_bar_test.dart deleted file mode 100644 index ecc49885..00000000 --- a/test/src/components/top_app_bar/extended_top_app_bar_test.dart +++ /dev/null @@ -1,169 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:zeta_flutter/zeta_flutter.dart'; - -import '../../../test_utils/test_app.dart'; -import '../../../test_utils/tolerant_comparator.dart'; -import '../../../test_utils/utils.dart'; - -void main() { - const goldenFile = GoldenFiles(component: 'top_app_bar'); - - setUpAll(() { - goldenFileComparator = TolerantComparator(goldenFile.uri); - }); - - testWidgets('ZetaExtendedAppBarDelegate builds correctly', (WidgetTester tester) async { - const title = Text('Title'); - final actions = [IconButton(icon: const Icon(Icons.search), onPressed: () {})]; - final leading = IconButton(icon: const Icon(Icons.menu), onPressed: () {}); - const boxKey = Key('box'); - tester.view.devicePixelRatio = 1.0; - tester.view.physicalSize = const Size(481, 480); - - await tester.pumpWidget( - TestApp( - home: Builder( - builder: (context) { - return SizedBox( - child: CustomScrollView( - slivers: [ - ZetaTopAppBar.extended(leading: leading, title: title, actions: actions), - SliverToBoxAdapter( - child: Container( - width: 800, - height: 700, - color: Zeta.of(context).colors.surfaceSelectedHover, - key: boxKey, - ), - ), - ], - ), - ); - }, - ), - ), - ); - - final boxFinder = find.byKey(boxKey); - expect(boxFinder, findsOneWidget); - - await tester.drag(boxFinder.first, const Offset(0, -100)); - await tester.pumpAndSettle(); - - final appBarFinder = find.byType(ZetaTopAppBar); - expect(appBarFinder, findsOneWidget); - - final titleFinder = find.descendant(of: appBarFinder, matching: find.byWidget(title)); - expect(titleFinder, findsOneWidget); - - final actionsFinder = find.descendant(of: appBarFinder, matching: find.byWidget(actions[0])); - expect(actionsFinder, findsOneWidget); - - final leadingFinder = find.descendant(of: appBarFinder, matching: find.byWidget(leading)); - expect(leadingFinder, findsOneWidget); - - await expectLater( - appBarFinder, - matchesGoldenFile(goldenFile.getFileUri('extended_app_bar_shrinks')), - ); - }); - - testWidgets('ZetaExtendedAppBarDelegate shrinks correctly with padding', (WidgetTester tester) async { - const title = Text('Title'); - final actions = [IconButton(icon: const Icon(Icons.search), onPressed: () {})]; - final leading = IconButton(icon: const Icon(Icons.menu), onPressed: () {}); - const boxKey = Key('box'); - tester.view.devicePixelRatio = 1.0; - tester.view.physicalSize = const Size(481, 480); - - await tester.pumpWidget( - TestApp( - home: Builder( - builder: (context) { - return SizedBox( - child: CustomScrollView( - slivers: [ - ZetaTopAppBar.extended(leading: leading, title: title, actions: actions), - SliverToBoxAdapter( - child: Container( - width: 800, - height: 700, - color: Zeta.of(context).colors.surfaceSelectedHover, - key: boxKey, - ), - ), - ], - ), - ); - }, - ), - ), - ); - - final boxFinder = find.byKey(boxKey); - expect(boxFinder, findsOneWidget); - - await tester.drag(boxFinder.first, const Offset(0, -100)); - await tester.pumpAndSettle(); - - final appBarFinder = find.byType(ZetaTopAppBar); - expect(appBarFinder, findsOneWidget); - - final positionedFinder = find.descendant(of: appBarFinder, matching: find.byType(Positioned)); - - final positionedWidget = tester.widget(positionedFinder.first); - expect(positionedWidget.left, 60); - }); - testWidgets('ZetaExtendedAppBarDelegate shrinks correctly with padding and no leading', (WidgetTester tester) async { - const title = Text('Title'); - final actions = [IconButton(icon: const Icon(Icons.search), onPressed: () {})]; - - const boxKey = Key('box'); - tester.view.devicePixelRatio = 1.0; - tester.view.physicalSize = const Size(481, 480); - - await tester.pumpWidget( - TestApp( - home: Builder( - builder: (context) { - return SizedBox( - child: CustomScrollView( - slivers: [ - ZetaTopAppBar.extended(title: title, actions: actions), - SliverToBoxAdapter( - child: Container( - width: 800, - height: 700, - color: Zeta.of(context).colors.surfaceSelectedHover, - key: boxKey, - ), - ), - ], - ), - ); - }, - ), - ), - ); - - final boxFinder = find.byKey(boxKey); - expect(boxFinder, findsOneWidget); - - await tester.drag(boxFinder.first, const Offset(0, -100)); - await tester.pumpAndSettle(); - - final appBarFinder = find.byType(ZetaTopAppBar); - expect(appBarFinder, findsOneWidget); - - final positionedFinder = find.descendant(of: appBarFinder, matching: find.byType(Positioned)); - - final positionedWidget = tester.widget(positionedFinder.first); - expect(positionedWidget.left, 16); - - await expectLater( - appBarFinder, - matchesGoldenFile(goldenFile.getFileUri('extended_app_bar_shrinks_with_no_leading')), - ); - }); -} diff --git a/test/src/components/top_app_bar/golden/extended_app_bar_shrinks.png b/test/src/components/top_app_bar/golden/extended_app_bar_shrinks.png index 6a0c1237..b821a451 100644 Binary files a/test/src/components/top_app_bar/golden/extended_app_bar_shrinks.png and b/test/src/components/top_app_bar/golden/extended_app_bar_shrinks.png differ diff --git a/test/src/components/top_app_bar/golden/extended_app_bar_shrinks_with_no_leading.png b/test/src/components/top_app_bar/golden/extended_app_bar_shrinks_with_no_leading.png index 87b9ce7d..7b4e3f6e 100644 Binary files a/test/src/components/top_app_bar/golden/extended_app_bar_shrinks_with_no_leading.png and b/test/src/components/top_app_bar/golden/extended_app_bar_shrinks_with_no_leading.png differ diff --git a/test/src/components/top_app_bar/golden/top_app_bar_centered.png b/test/src/components/top_app_bar/golden/top_app_bar_centered.png new file mode 100644 index 00000000..ce49f585 Binary files /dev/null and b/test/src/components/top_app_bar/golden/top_app_bar_centered.png differ diff --git a/test/src/components/top_app_bar/golden/top_app_bar_centered_actions.png b/test/src/components/top_app_bar/golden/top_app_bar_centered_actions.png new file mode 100644 index 00000000..2e6ac890 Binary files /dev/null and b/test/src/components/top_app_bar/golden/top_app_bar_centered_actions.png differ diff --git a/test/src/components/top_app_bar/golden/top_app_bar_default.png b/test/src/components/top_app_bar/golden/top_app_bar_default.png index e17872e8..ae2508eb 100644 Binary files a/test/src/components/top_app_bar/golden/top_app_bar_default.png and b/test/src/components/top_app_bar/golden/top_app_bar_default.png differ diff --git a/test/src/components/top_app_bar/golden/top_app_bar_default_actions.png b/test/src/components/top_app_bar/golden/top_app_bar_default_actions.png new file mode 100644 index 00000000..725391c6 Binary files /dev/null and b/test/src/components/top_app_bar/golden/top_app_bar_default_actions.png differ diff --git a/test/src/components/top_app_bar/golden/top_app_bar_extended.png b/test/src/components/top_app_bar/golden/top_app_bar_extended.png new file mode 100644 index 00000000..11817f09 Binary files /dev/null and b/test/src/components/top_app_bar/golden/top_app_bar_extended.png differ diff --git a/test/src/components/top_app_bar/golden/top_app_bar_extended_actions.png b/test/src/components/top_app_bar/golden/top_app_bar_extended_actions.png new file mode 100644 index 00000000..9677a10e Binary files /dev/null and b/test/src/components/top_app_bar/golden/top_app_bar_extended_actions.png differ diff --git a/test/src/components/top_app_bar/golden/top_app_bar_search.png b/test/src/components/top_app_bar/golden/top_app_bar_search.png new file mode 100644 index 00000000..00604a33 Binary files /dev/null and b/test/src/components/top_app_bar/golden/top_app_bar_search.png differ diff --git a/test/src/components/top_app_bar/golden/top_app_bar_search_active.png b/test/src/components/top_app_bar/golden/top_app_bar_search_active.png new file mode 100644 index 00000000..378baace Binary files /dev/null and b/test/src/components/top_app_bar/golden/top_app_bar_search_active.png differ diff --git a/test/src/components/top_app_bar/golden/top_app_bar_search_centered.png b/test/src/components/top_app_bar/golden/top_app_bar_search_centered.png new file mode 100644 index 00000000..e65986b0 Binary files /dev/null and b/test/src/components/top_app_bar/golden/top_app_bar_search_centered.png differ diff --git a/test/src/components/top_app_bar/top_app_bar_test.dart b/test/src/components/top_app_bar/top_app_bar_test.dart index 82c537c4..8ae60e83 100644 --- a/test/src/components/top_app_bar/top_app_bar_test.dart +++ b/test/src/components/top_app_bar/top_app_bar_test.dart @@ -7,7 +7,6 @@ import '../../../test_utils/tolerant_comparator.dart'; import '../../../test_utils/utils.dart'; void main() { - const String componentName = 'ZetaTopAppbar'; const String parentFolder = 'top_app_bar'; const goldenFile = GoldenFiles(component: parentFolder); @@ -15,8 +14,8 @@ void main() { goldenFileComparator = TolerantComparator(goldenFile.uri); }); - group('$componentName Accessibility Tests', () { - testWidgets('$componentName meets accessibility requirements', (WidgetTester tester) async { + group('ZetaTopAppBar Accessibility Tests', () { + testWidgets('ZetaTopAppBar meets accessibility requirements', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); await tester.pumpWidget( TestApp( @@ -27,7 +26,7 @@ void main() { icon: const Icon(Icons.search), tooltip: 'Search', onPressed: () {}, - ) + ), ], leading: IconButton( icon: const Icon(Icons.menu), @@ -45,7 +44,7 @@ void main() { handle.dispose(); }); - testWidgets('$componentName passes semantic labels to the search actions', (WidgetTester tester) async { + testWidgets('ZetaTopAppBar passes semantic labels to the search actions', (WidgetTester tester) async { const microphoneSemanticLabel = 'Search with voice'; const clearSemanticLabel = 'Clear search'; const searchBackSemanticLabel = 'Back'; @@ -88,7 +87,7 @@ void main() { }); }); - group('$componentName Content Tests', () { + group('ZetaTopAppBar Content Tests', () { final debugFillProperties = { 'titleTextStyle': 'null', 'onSearch': 'null', @@ -98,16 +97,157 @@ void main() { 'searchHintText': 'null', 'type': 'defaultAppBar', 'shrinks': 'false', + 'clearSemanticLabel': 'null', + 'microphoneSemanticLabel': 'null', + 'searchSemanticLabel': 'null', + 'searchBackSemanticLabel': 'null', }; debugFillPropertiesTest( const ZetaTopAppBar(), debugFillProperties, ); + + test( + 'ZetaTopAppBar Search throws an assertion error if its type is set to extended', + () { + expect( + () => ZetaTopAppBar.search( + title: const Text('Title'), + type: ZetaTopAppBarType.extended, + ), + throwsA(isA()), + ); + }, + ); + + testWidgets('ZetaTopAppBar displays the title correctly', (WidgetTester tester) async { + await tester.pumpWidget( + const TestApp( + home: ZetaTopAppBar( + title: Text('Title'), + ), + ), + ); + + expect(find.text('Title'), findsOneWidget); + }); + + testWidgets('ZetaTopAppBar displays the leading widget correctly', (WidgetTester tester) async { + await tester.pumpWidget( + TestApp( + home: ZetaTopAppBar( + title: const Text('Title'), + leading: IconButton( + icon: const Icon(Icons.menu), + onPressed: () {}, + ), + ), + ), + ); + + expect(find.byIcon(Icons.menu), findsOneWidget); + }); + + testWidgets('ZetaTopAppBar displays the actions correctly', (WidgetTester tester) async { + await tester.pumpWidget( + TestApp( + home: ZetaTopAppBar( + title: const Text('Title'), + actions: [ + IconButton( + icon: const Icon(Icons.search), + onPressed: () {}, + ), + ], + ), + ), + ); + + expect(find.byIcon(Icons.search), findsOneWidget); + }); + + testWidgets('ZetaExtendedAppBarDelegate builds correctly', (WidgetTester tester) async { + const title = Text('Title'); + final actions = [IconButton(icon: const Icon(Icons.search), onPressed: () {})]; + final leading = IconButton(icon: const Icon(Icons.menu), onPressed: () {}); + const boxKey = Key('box'); + + await tester.pumpWidget( + TestApp( + home: Builder( + builder: (context) { + return SizedBox( + child: CustomScrollView( + slivers: [ + ZetaTopAppBar.extended(leading: leading, title: title, actions: actions), + SliverToBoxAdapter( + child: Container( + width: 800, + height: 700, + color: Zeta.of(context).colors.surfaceSelectedHover, + key: boxKey, + ), + ), + ], + ), + ); + }, + ), + ), + ); + + final boxFinder = find.byKey(boxKey); + expect(boxFinder, findsOneWidget); + + await tester.drag(boxFinder.first, const Offset(0, -100)); + await tester.pumpAndSettle(); + + final appBarFinder = find.byType(ZetaTopAppBar); + expect(appBarFinder, findsOneWidget); + + final titleFinder = find.descendant(of: appBarFinder, matching: find.byWidget(title)); + expect(titleFinder, findsOneWidget); + + final actionsFinder = find.descendant(of: appBarFinder, matching: find.byWidget(actions[0])); + expect(actionsFinder, findsOneWidget); + + final leadingFinder = find.descendant(of: appBarFinder, matching: find.byWidget(leading)); + expect(leadingFinder, findsOneWidget); + }); }); - group('$componentName Dimensions Tests', () {}); - group('$componentName Styling Tests', () {}); - group('$componentName Interaction Tests', () { + group('ZetaTopAppBar Dimensions Tests', () { + testWidgets('ZetaTopAppBar has the correct height', (WidgetTester tester) async { + await tester.pumpWidget( + const TestApp( + home: ZetaTopAppBar( + title: Text('Title'), + ), + ), + ); + + final appBar = tester.widget(find.byType(AppBar)); + expect(appBar.preferredSize.height, 64); + }); + }); + + group('ZetaTopAppBar Styling Tests', () { + testWidgets('ZetaTopAppBar has the correct background color', (WidgetTester tester) async { + await tester.pumpWidget( + const TestApp( + home: ZetaTopAppBar( + title: Text('Title'), + ), + ), + ); + + final BuildContext context = tester.element(find.byType(MaterialApp)); + final appBar = tester.widget(find.byType(AppBar)); + expect(appBar.backgroundColor, Zeta.of(context).colors.surfaceDefault); + }); + }); + + group('ZetaTopAppBar Interaction Tests', () { late ZetaSearchController searchController; const searchLabel = 'Search'; const clearLabel = 'Clear'; @@ -129,7 +269,7 @@ void main() { }); testWidgets( - '$componentName Search opens and closes the search bar when the search/back icon is tapped', + 'ZetaTopAppBar Search opens and closes the search bar when the search/back icon is tapped', (WidgetTester tester) async { await tester.pumpWidget(subject); @@ -147,7 +287,7 @@ void main() { ); testWidgets( - '$componentName Search allows text to be typed in the search field', + 'ZetaTopAppBar Search allows text to be typed in the search field', (WidgetTester tester) async { await tester.pumpWidget(subject); @@ -160,7 +300,7 @@ void main() { ); testWidgets( - '$componentName Search gets cleared when the clear button is tapped', + 'ZetaTopAppBar Search gets cleared when the clear button is tapped', (WidgetTester tester) async { await tester.pumpWidget(subject); @@ -174,7 +314,7 @@ void main() { ); testWidgets( - '$componentName Search submits the correct text when the search input is submitted', + 'ZetaTopAppBar Search submits the correct text when the search input is submitted', (WidgetTester tester) async { String inputtedText = ''; await tester.pumpWidget( @@ -197,18 +337,221 @@ void main() { expect(inputtedText, 'Search text'); }, ); + + testWidgets('ZetaExtendedAppBarDelegate shrinks correctly with padding', (WidgetTester tester) async { + const title = Text('Title'); + final actions = [IconButton(icon: const Icon(Icons.search), onPressed: () {})]; + final leading = IconButton(icon: const Icon(Icons.menu), onPressed: () {}); + const boxKey = Key('box'); + + await tester.pumpWidget( + TestApp( + home: Builder( + builder: (context) { + return SizedBox( + child: CustomScrollView( + slivers: [ + ZetaTopAppBar.extended(leading: leading, title: title, actions: actions), + SliverToBoxAdapter( + child: Container( + width: 800, + height: 700, + color: Zeta.of(context).colors.surfaceSelectedHover, + key: boxKey, + ), + ), + ], + ), + ); + }, + ), + ), + ); + + final boxFinder = find.byKey(boxKey); + expect(boxFinder, findsOneWidget); + + await tester.drag(boxFinder.first, const Offset(0, -100)); + await tester.pumpAndSettle(); + + final appBarFinder = find.byType(ZetaTopAppBar); + expect(appBarFinder, findsOneWidget); + + final positionedFinder = find.descendant(of: appBarFinder, matching: find.byType(Positioned)); + + final positionedWidget = tester.widget(positionedFinder.first); + expect(positionedWidget.left, 64); + }); + + testWidgets('ZetaExtendedAppBarDelegate shrinks correctly with padding and no leading', + (WidgetTester tester) async { + const title = Text('Title'); + final actions = [IconButton(icon: const Icon(Icons.search), onPressed: () {})]; + + const boxKey = Key('box'); + + await tester.pumpWidget( + TestApp( + home: Builder( + builder: (context) { + return SizedBox( + child: CustomScrollView( + slivers: [ + ZetaTopAppBar.extended(title: title, actions: actions), + SliverToBoxAdapter( + child: Container( + width: 800, + height: 700, + color: Zeta.of(context).colors.surfaceSelectedHover, + key: boxKey, + ), + ), + ], + ), + ); + }, + ), + ), + ); + + final boxFinder = find.byKey(boxKey); + expect(boxFinder, findsOneWidget); + + await tester.drag(boxFinder.first, const Offset(0, -100)); + await tester.pumpAndSettle(); + + final appBarFinder = find.byType(ZetaTopAppBar); + expect(appBarFinder, findsOneWidget); + + final positionedFinder = find.descendant(of: appBarFinder, matching: find.byType(Positioned)); + + final positionedWidget = tester.widget(positionedFinder.first); + expect(positionedWidget.left, 16); + }); }); - group('$componentName Golden Tests', () { + group('ZetaTopAppBar Golden Tests', () { goldenTest( goldenFile, const ZetaTopAppBar( title: Text('Title'), ), - ZetaTopAppBar, 'top_app_bar_default', ); + + goldenTest( + goldenFile, + ZetaTopAppBar( + title: const Text('Title'), + leading: IconButton(onPressed: () {}, icon: const Icon(Icons.menu)), + actions: [ + IconButton( + icon: const Icon(Icons.search), + tooltip: 'Search', + onPressed: () {}, + ), + ], + ), + 'top_app_bar_default_actions', + ); + + goldenTest( + goldenFile, + const ZetaTopAppBar.centered( + title: Text('Title'), + ), + 'top_app_bar_centered', + ); + + goldenTest( + goldenFile, + ZetaTopAppBar.centered( + leading: IconButton(onPressed: () {}, icon: const Icon(Icons.menu)), + actions: [ + IconButton( + icon: const Icon(Icons.search), + tooltip: 'Search', + onPressed: () {}, + ), + ], + title: const Text('Title'), + ), + 'top_app_bar_centered_actions', + ); + + goldenTest( + goldenFile, + const ZetaTopAppBar.search( + title: Text('Search'), + ), + 'top_app_bar_search', + ); + + goldenTest( + goldenFile, + const ZetaTopAppBar.search( + title: Text('Search'), + type: ZetaTopAppBarType.centered, + ), + 'top_app_bar_search_centered', + ); + + final searchController = ZetaSearchController(); + goldenTest( + goldenFile, + ZetaTopAppBar.search( + title: const Text('Search'), + type: ZetaTopAppBarType.centered, + searchController: searchController, + ), + beforeComparison: (tester) async { + searchController.startSearch(); + await tester.pumpAndSettle(); + }, + 'top_app_bar_search_active', + ); + + goldenTest( + goldenFile, + const CustomScrollView( + slivers: [ + ZetaTopAppBar.extended( + title: Text('Title'), + ), + ], + ), + widgetType: ZetaTopAppBar, + beforeComparison: (tester) async { + searchController.startSearch(); + await tester.pumpAndSettle(); + }, + 'top_app_bar_extended', + ); + + goldenTest( + goldenFile, + CustomScrollView( + slivers: [ + ZetaTopAppBar.extended( + title: const Text('Title'), + actions: [ + IconButton( + icon: const Icon(Icons.search), + tooltip: 'Search', + onPressed: () {}, + ), + ], + ), + ], + ), + widgetType: ZetaTopAppBar, + beforeComparison: (tester) async { + searchController.startSearch(); + await tester.pumpAndSettle(); + }, + 'top_app_bar_extended_actions', + ); }); - group('$componentName Performance Tests', () {}); + group('ZetaTopAppBar Performance Tests', () {}); } diff --git a/test/test_utils/utils.dart b/test/test_utils/utils.dart index 5117d045..ec5c9704 100644 --- a/test/test_utils/utils.dart +++ b/test/test_utils/utils.dart @@ -34,13 +34,19 @@ class GoldenFiles { void goldenTest( GoldenFiles goldenFile, Widget widget, - Type widgetType, String fileName, { + Type? widgetType, ThemeMode themeMode = ThemeMode.system, Size? screenSize, bool? rounded, + Future Function(WidgetTester)? setUp, + Future Function(WidgetTester)? beforeComparison, }) { testWidgets('$fileName golden', (WidgetTester tester) async { + final computedType = widgetType ?? widget.runtimeType; + if (setUp != null) { + await setUp(tester); + } await tester.pumpWidget( TestApp( screenSize: screenSize, @@ -50,42 +56,12 @@ void goldenTest( ), ); - await expectLater( - find.byType(widgetType), - matchesGoldenFile(goldenFile.getFileUri(fileName)), - ); - }); -} - -void goldenTestWithCallbacks( - GoldenFiles goldenFile, - Widget widget, - Type widgetType, - String fileName, { - Future Function(WidgetTester)? before, - Future Function(WidgetTester)? after, - bool darkMode = false, - Size? screenSize, -}) { - testWidgets('$fileName golden', (WidgetTester tester) async { - if (before != null) { - await before(tester); - } - - await tester.pumpWidget( - TestApp( - screenSize: screenSize, - themeMode: darkMode ? ThemeMode.dark : ThemeMode.light, - home: widget, - ), - ); - - if (after != null) { - await after(tester); + if (beforeComparison != null) { + await beforeComparison(tester); } await expectLater( - find.byType(widgetType), + find.byType(computedType), matchesGoldenFile(goldenFile.getFileUri(fileName)), ); });