test(localization): add remaining tests

Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
Sahil Kumar
2021-07-22 17:46:28 +05:30
committed by xsahil03x
parent 8b138645e1
commit 37a81ebb88
@@ -161,4 +161,25 @@ void main() {
expect(localizations.replyToMessageLabel, isNotNull);
});
}
test('should throw if try to load locale which is not supported', () async {
const locale = Locale('not-supported-locale');
expect(
GlobalStreamChatLocalizations.delegate.isSupported(locale),
isFalse,
);
try {
await GlobalStreamChatLocalizations.delegate.load(locale);
} catch (e) {
expect(e, isA<AssertionError>());
}
});
test('`.toString`', () {
final supportedLocales = kStreamChatSupportedLanguages;
expect(
GlobalStreamChatLocalizations.delegate.toString(),
'GlobalStreamChatLocalizations.delegate($supportedLocales locales)',
);
});
}