fix tests
This commit is contained in:
@@ -296,13 +296,13 @@ class Channel {
|
|||||||
it.file!,
|
it.file!,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
).then((it) => it!.file);
|
).then((it) => it.file);
|
||||||
} else {
|
} else {
|
||||||
future = sendFile(
|
future = sendFile(
|
||||||
it.file!,
|
it.file!,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
).then((it) => it!.file);
|
).then((it) => it.file);
|
||||||
}
|
}
|
||||||
_cancelableAttachmentUploadRequest[it.id] = cancelToken;
|
_cancelableAttachmentUploadRequest[it.id] = cancelToken;
|
||||||
return future.then((url) {
|
return future.then((url) {
|
||||||
@@ -886,7 +886,7 @@ class Channel {
|
|||||||
ChannelState response;
|
ChannelState response;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
response = await query(options: watchOptions)!;
|
response = await query(options: watchOptions);
|
||||||
} catch (error, stackTrace) {
|
} catch (error, stackTrace) {
|
||||||
if (!_initializedCompleter.isCompleted) {
|
if (!_initializedCompleter.isCompleted) {
|
||||||
_initializedCompleter.completeError(error, stackTrace);
|
_initializedCompleter.completeError(error, stackTrace);
|
||||||
@@ -1511,7 +1511,7 @@ class ChannelClientState {
|
|||||||
)
|
)
|
||||||
.listen((event) {
|
.listen((event) {
|
||||||
final message = event.message!;
|
final message = event.message!;
|
||||||
if (isUpToDate! ||
|
if (isUpToDate ||
|
||||||
(message.parentId != null && message.showInChannel != true)) {
|
(message.parentId != null && message.showInChannel != true)) {
|
||||||
addMessage(message);
|
addMessage(message);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1200,8 +1200,8 @@ void main() {
|
|||||||
|
|
||||||
verify(() => mockDio.post<String>('/channels/messaging/query',
|
verify(() => mockDio.post<String>('/channels/messaging/query',
|
||||||
data: options)).called(1);
|
data: options)).called(1);
|
||||||
expect(channelClient.id, response?.channel?.id);
|
expect(channelClient.id, response.channel?.id);
|
||||||
expect(channelClient.cid, response?.channel?.cid);
|
expect(channelClient.cid, response.channel?.cid);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('with id', () async {
|
test('with id', () async {
|
||||||
@@ -1837,8 +1837,8 @@ void main() {
|
|||||||
|
|
||||||
verify(() => mockDio.post<String>('/channels/messaging/query',
|
verify(() => mockDio.post<String>('/channels/messaging/query',
|
||||||
data: options)).called(1);
|
data: options)).called(1);
|
||||||
expect(channelClient.id, response?.channel?.id);
|
expect(channelClient.id, response.channel?.id);
|
||||||
expect(channelClient.cid, response?.channel?.cid);
|
expect(channelClient.cid, response.channel?.cid);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('watch', () async {
|
test('watch', () async {
|
||||||
|
|||||||
@@ -102,7 +102,6 @@ void main() {
|
|||||||
id: '4637f7e4-a06b-42db-ba5a-8d8270dd926f',
|
id: '4637f7e4-a06b-42db-ba5a-8d8270dd926f',
|
||||||
text:
|
text:
|
||||||
'https://giphy.com/gifs/the-lion-king-live-action-5zvN79uTGfLMOVfQaA',
|
'https://giphy.com/gifs/the-lion-king-live-action-5zvN79uTGfLMOVfQaA',
|
||||||
silent: false,
|
|
||||||
attachments: [
|
attachments: [
|
||||||
Attachment.fromJson(const {
|
Attachment.fromJson(const {
|
||||||
'type': 'video',
|
'type': 'video',
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:test/test.dart';
|
|
||||||
import 'package:stream_chat/src/models/reaction.dart';
|
import 'package:stream_chat/src/models/reaction.dart';
|
||||||
import 'package:stream_chat/src/models/user.dart';
|
import 'package:stream_chat/src/models/user.dart';
|
||||||
|
import 'package:test/test.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
group('src/models/reaction', () {
|
group('src/models/reaction', () {
|
||||||
@@ -33,7 +33,7 @@ void main() {
|
|||||||
expect(reaction.createdAt, DateTime.parse('2020-01-28T22:17:31.108742Z'));
|
expect(reaction.createdAt, DateTime.parse('2020-01-28T22:17:31.108742Z'));
|
||||||
expect(reaction.type, 'wow');
|
expect(reaction.type, 'wow');
|
||||||
expect(
|
expect(
|
||||||
reaction.user.toJson(),
|
reaction.user?.toJson(),
|
||||||
User(id: '2de0297c-f3f2-489d-b930-ef77342edccf', extraData: {
|
User(id: '2de0297c-f3f2-489d-b930-ef77342edccf', extraData: {
|
||||||
'image': 'https://randomuser.me/api/portraits/women/45.jpg',
|
'image': 'https://randomuser.me/api/portraits/women/45.jpg',
|
||||||
'name': 'Daisy Morgan'
|
'name': 'Daisy Morgan'
|
||||||
|
|||||||
Reference in New Issue
Block a user