From 075f9414de286114a4fd89c2e36b31ad41486f34 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Tue, 3 May 2022 15:44:03 +0200 Subject: [PATCH] fix localization tests --- packages/stream_chat_flutter/pubspec.yaml | 2 +- packages/stream_chat_localizations/test/basics_test.dart | 8 ++++---- .../stream_chat_localizations/test/override_test.dart | 7 ++++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/stream_chat_flutter/pubspec.yaml b/packages/stream_chat_flutter/pubspec.yaml index 5bdd1654..69e7c42c 100644 --- a/packages/stream_chat_flutter/pubspec.yaml +++ b/packages/stream_chat_flutter/pubspec.yaml @@ -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 diff --git a/packages/stream_chat_localizations/test/basics_test.dart b/packages/stream_chat_localizations/test/basics_test.dart index c1315a9a..8491a332 100644 --- a/packages/stream_chat_localizations/test/basics_test.dart +++ b/packages/stream_chat_localizations/test/basics_test.dart @@ -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 { @@ -41,6 +41,8 @@ void main() { localizationsDelegates: const [ DummyLocalizations.delegate, GlobalStreamChatLocalizations.delegate, + GlobalMaterialLocalizations.delegate, + GlobalCupertinoLocalizations.delegate, ], home: PageView(), )); @@ -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 >[ - GlobalStreamChatLocalizations.delegate, - ], + localizationsDelegates: GlobalStreamChatLocalizations.delegates, supportedLocales: const [ Locale('en', 'US'), Locale('hi'), diff --git a/packages/stream_chat_localizations/test/override_test.dart b/packages/stream_chat_localizations/test/override_test.dart index 513dd336..a30bb09a 100644 --- a/packages/stream_chat_localizations/test/override_test.dart +++ b/packages/stream_chat_localizations/test/override_test.dart @@ -166,8 +166,8 @@ void main() { final Key textKey = UniqueKey(); await tester.pumpWidget(buildFrame( - delegates: >[ - GlobalStreamChatLocalizations.delegate, + delegates: [ + ...GlobalStreamChatLocalizations.delegates, const FooStreamChatLocalizationsDelegate( supportedLanguage: 'fr', launchUrlError: "Impossible de lancer l'url", @@ -217,10 +217,11 @@ void main() { // Accept whatever locale we're given localeResolutionCallback: (Locale? locale, Iterable supportedLocales) => locale, - delegates: [ + delegates: [ const FooStreamChatLocalizationsDelegate( supportedLanguage: 'allLanguages', ), + ...GlobalStreamChatLocalizations.delegates, ], buildContent: (BuildContext context) { // Should always be 'foo', no matter what the locale is