added null safety for llc

This commit is contained in:
Deven Joshi
2021-04-08 15:03:16 +05:30
parent 3a5308a9c0
commit c80fc0a6b4
41 changed files with 1222 additions and 1202 deletions
@@ -50,7 +50,7 @@ void main() {
),
);
await channelClient.sendMessage(message);
await channelClient?.sendMessage(message);
verify(() =>
mockDio.post<String>('/channels/messaging/testid/message', data: {
@@ -80,7 +80,7 @@ void main() {
statusCode: 200,
requestOptions: FakeRequestOptions(),
));
await channelClient.watch();
await channelClient?.watch();
when(
() => mockDio.post<String>(
@@ -95,7 +95,7 @@ void main() {
),
);
await channelClient.markRead();
await channelClient?.markRead();
verify(() => mockDio.post<String>('/channels/messaging/testid/read',
data: {})).called(1);
@@ -124,7 +124,7 @@ void main() {
),
);
await channelClient.getReplies('messageid', pagination);
await channelClient?.getReplies('messageid', pagination);
verify(() => mockDio.get<String>('/messages/messageid/replies',
queryParameters: pagination.toJson())).called(1);
@@ -141,7 +141,7 @@ void main() {
httpClient: mockDio,
tokenProvider: (_) async => '',
);
final channelClient = client.channel('messaging', id: 'testid');
Channel channelClient = client.channel('messaging', id: 'testid');
when(() => mockDio.post<String>(
any(),
@@ -564,7 +564,11 @@ void main() {
'api-key',
httpClient: mockDio,
tokenProvider: (_) async => '',
)..state.user = OwnUser(id: 'test-id');
);
if (client != null) {
client.state?.user = OwnUser(id: 'test-id');
}
final channelClient = client.channel('messaging', id: 'testid');
const reactionType = 'test';
@@ -617,7 +621,11 @@ void main() {
'api-key',
httpClient: mockDio,
tokenProvider: (_) async => '',
)..state.user = OwnUser(id: 'test-id');
);
if (client != null) {
client.state?.user = OwnUser(id: 'test-id');
}
final channelClient = client.channel('messaging', id: 'testid');
@@ -1069,8 +1077,8 @@ void main() {
verify(() => mockDio.post<String>('/channels/messaging/query',
data: options)).called(1);
expect(channelClient.id, response.channel.id);
expect(channelClient.cid, response.channel.cid);
expect(channelClient.id, response?.channel?.id);
expect(channelClient.cid, response?.channel?.cid);
});
test('with id', () async {
@@ -1706,8 +1714,8 @@ void main() {
verify(() => mockDio.post<String>('/channels/messaging/query',
data: options)).called(1);
expect(channelClient.id, response.channel.id);
expect(channelClient.cid, response.channel.cid);
expect(channelClient.id, response?.channel?.id);
expect(channelClient.cid, response?.channel?.cid);
});
test('watch', () async {
@@ -2027,8 +2035,8 @@ void main() {
verify(() => mockDio.post<String>('/channels/messaging/query',
data: options)).called(1);
expect(channelClient.id, response.channel.id);
expect(channelClient.cid, response.channel.cid);
expect(channelClient.id, response.channel?.id);
expect(channelClient.cid, response.channel?.cid);
});
test('stopWatching', () async {