Skip to content

Commit

Permalink
fix(widgetbook): 🐛 ignores country codes
Browse files Browse the repository at this point in the history
  • Loading branch information
jenshor committed Feb 6, 2023
1 parent 5af86af commit bd1d5ec
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,31 @@ void main() {
);
},
);

// Test for https://github.com/widgetbook/widgetbook/issues/232
testWidgets(
'supports locales with same language code',
(tester) async {
await testAddon(
tester: tester,
build: (child) => localeAddonWrapper(
child: child,
locales: [
engLocaleUs,
engLocaleGb,
],
activeLocale: engLocaleUs,
),
child: renderer,
act: (context) async =>
context.read<LocalizationSettingProvider>()..tapped(engLocaleGb),
expect: () {
final context = tester.findContextByKey(textKey);
final provider = context.read<LocalizationProvider>();
expect(provider.value.activeLocale, equals(engLocaleGb));
},
);
},
);
});
}

0 comments on commit bd1d5ec

Please sign in to comment.