Skip to content

Commit

Permalink
fix localization tests
Browse files Browse the repository at this point in the history
  • Loading branch information
imtoori committed May 3, 2022
1 parent 7f562d3 commit 075f941
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/stream_chat_flutter/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ dependencies:
shimmer: ^2.0.0
stream_chat_flutter_core: ^4.0.1
substring_highlight: ^1.0.26
url_launcher: ^6.0.3
url_launcher: ^6.1.0
video_player: ^2.1.0
video_thumbnail: ^0.5.0

Expand Down
8 changes: 4 additions & 4 deletions packages/stream_chat_localizations/test/basics_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:stream_chat_localizations/src/stream_chat_localizations.dart';
import 'package:stream_chat_localizations/stream_chat_localizations.dart';

void main() {
testWidgets('Nested Localizations', (WidgetTester tester) async {
Expand Down Expand Up @@ -41,6 +41,8 @@ void main() {
localizationsDelegates: const [
DummyLocalizations.delegate,
GlobalStreamChatLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
home: PageView(),
));
Expand All @@ -54,9 +56,7 @@ void main() {
testWidgets('Locale without countryCode', (WidgetTester tester) async {
// Regression test for https://github.com/flutter/flutter/pull/16782
await tester.pumpWidget(MaterialApp(
localizationsDelegates: const <LocalizationsDelegate<dynamic>>[
GlobalStreamChatLocalizations.delegate,
],
localizationsDelegates: GlobalStreamChatLocalizations.delegates,
supportedLocales: const <Locale>[
Locale('en', 'US'),
Locale('hi'),
Expand Down
7 changes: 4 additions & 3 deletions packages/stream_chat_localizations/test/override_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ void main() {
final Key textKey = UniqueKey();

await tester.pumpWidget(buildFrame(
delegates: <LocalizationsDelegate<StreamChatLocalizations>>[
GlobalStreamChatLocalizations.delegate,
delegates: <LocalizationsDelegate>[
...GlobalStreamChatLocalizations.delegates,
const FooStreamChatLocalizationsDelegate(
supportedLanguage: 'fr',
launchUrlError: "Impossible de lancer l'url",
Expand Down Expand Up @@ -217,10 +217,11 @@ void main() {
// Accept whatever locale we're given
localeResolutionCallback:
(Locale? locale, Iterable<Locale> supportedLocales) => locale,
delegates: <FooStreamChatLocalizationsDelegate>[
delegates: [
const FooStreamChatLocalizationsDelegate(
supportedLanguage: 'allLanguages',
),
...GlobalStreamChatLocalizations.delegates,
],
buildContent: (BuildContext context) {
// Should always be 'foo', no matter what the locale is
Expand Down

0 comments on commit 075f941

Please sign in to comment.