Merge remote-tracking branch 'origin/develop' into cds-328

# Conflicts:
#	packages/stream_chat/CHANGELOG.md
This commit is contained in:
xsahil03x
2021-07-26 14:15:48 +05:30
38 changed files with 890 additions and 352 deletions
@@ -595,14 +595,14 @@ void main() {
final path = '${_getChannelUrl(channelId, channelType)}/stop-watching';
when(() => client.post(path)).thenAnswer(
when(() => client.post(path, data: {})).thenAnswer(
(_) async => successResponse(path, data: <String, dynamic>{}));
final res = await channelApi.stopWatching(channelId, channelType);
expect(res, isNotNull);
verify(() => client.post(path)).called(1);
verify(() => client.post(path, data: {})).called(1);
verifyNoMoreInteractions(client);
});
}
@@ -9,6 +9,8 @@ void main() {
expect(options.baseUrl, 'https://chat-us-east-1.stream-io-api.com');
expect(options.connectTimeout, const Duration(seconds: 6));
expect(options.receiveTimeout, const Duration(seconds: 6));
expect(options.queryParameters, const {});
expect(options.headers, const {});
});
test('should override all the default set params', () {
@@ -16,11 +18,15 @@ void main() {
baseUrl: 'base-url',
connectTimeout: Duration(seconds: 3),
receiveTimeout: Duration(seconds: 3),
headers: {'test': 'test'},
queryParameters: {'123': '123'},
);
expect(options.location, isNull);
expect(options.baseUrl, 'base-url');
expect(options.connectTimeout, const Duration(seconds: 3));
expect(options.receiveTimeout, const Duration(seconds: 3));
expect(options.headers, {'test': 'test'});
expect(options.queryParameters, {'123': '123'});
});
group('should create baseUrl according to provided location', () {
@@ -96,7 +96,7 @@ void main() {
await client.get('path');
} catch (_) {}
verify(() => logger.info(any())).called(16);
verify(() => logger.info(any())).called(greaterThan(0));
});
test('loggingInterceptor should log error', () async {
@@ -108,7 +108,7 @@ void main() {
await client.get('path');
} catch (_) {}
verify(() => logger.severe(any())).called(8);
verify(() => logger.severe(any())).called(greaterThan(0));
});
test('`.lock` should lock the dio client', () async {