fix tests
This commit is contained in:
@@ -60,10 +60,6 @@ void main() {
|
|||||||
)
|
)
|
||||||
]));
|
]));
|
||||||
|
|
||||||
when(() => channelState.typingEvents).thenReturn([]);
|
|
||||||
when(() => channelState.typingEventsStream)
|
|
||||||
.thenAnswer((_) => Stream.value([]));
|
|
||||||
|
|
||||||
await tester.pumpWidget(MaterialApp(
|
await tester.pumpWidget(MaterialApp(
|
||||||
home: StreamChat(
|
home: StreamChat(
|
||||||
client: client,
|
client: client,
|
||||||
|
|||||||
@@ -53,15 +53,15 @@ void main() {
|
|||||||
user: User(id: 'other-user'),
|
user: User(id: 'other-user'),
|
||||||
)
|
)
|
||||||
]));
|
]));
|
||||||
|
when(() => channelState.typingEvents).thenAnswer((i) => {
|
||||||
when(() => channelState.typingEvents).thenAnswer((i) => [
|
User(id: 'other-user', extraData: {'name': 'demo'}):
|
||||||
User(id: 'other-user', extraData: {'name': 'demo'})
|
const Event(type: EventType.typingStart),
|
||||||
]);
|
});
|
||||||
when(() => channelState.typingEventsStream)
|
when(() => channelState.typingEventsStream)
|
||||||
.thenAnswer((i) => Stream.value([
|
.thenAnswer((i) => Stream.value({
|
||||||
User(id: 'other-user', extraData: {'name': 'demo'}),
|
User(id: 'other-user', extraData: {'name': 'demo'}):
|
||||||
User(id: 'other-user', extraData: {'name': 'demo'}),
|
const Event(type: EventType.typingStart),
|
||||||
]));
|
}));
|
||||||
|
|
||||||
await tester.pumpWidget(MaterialApp(
|
await tester.pumpWidget(MaterialApp(
|
||||||
home: StreamChat(
|
home: StreamChat(
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ class MockChannel extends Mock implements Channel {
|
|||||||
|
|
||||||
class MockChannelState extends Mock implements ChannelClientState {
|
class MockChannelState extends Mock implements ChannelClientState {
|
||||||
MockChannelState() {
|
MockChannelState() {
|
||||||
when(() => typingEvents).thenReturn([]);
|
when(() => typingEvents).thenReturn({});
|
||||||
when(() => typingEventsStream).thenAnswer((_) => Stream.value([]));
|
when(() => typingEventsStream).thenAnswer((_) => Stream.value({}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,14 +53,15 @@ void main() {
|
|||||||
)
|
)
|
||||||
]));
|
]));
|
||||||
|
|
||||||
when(() => channelState.typingEvents).thenAnswer((i) => [
|
when(() => channelState.typingEvents).thenAnswer((i) => {
|
||||||
User(id: 'other-user', extraData: {'name': 'demo'})
|
User(id: 'other-user', extraData: {'name': 'demo'}):
|
||||||
]);
|
const Event(type: EventType.typingStart),
|
||||||
|
});
|
||||||
when(() => channelState.typingEventsStream)
|
when(() => channelState.typingEventsStream)
|
||||||
.thenAnswer((i) => Stream.value([
|
.thenAnswer((i) => Stream.value({
|
||||||
User(id: 'other-user', extraData: {'name': 'demo'}),
|
User(id: 'other-user', extraData: {'name': 'demo'}):
|
||||||
User(id: 'other-user', extraData: {'name': 'demo'}),
|
const Event(type: EventType.typingStart),
|
||||||
]));
|
}));
|
||||||
|
|
||||||
await tester.pumpWidget(MaterialApp(
|
await tester.pumpWidget(MaterialApp(
|
||||||
home: StreamChat(
|
home: StreamChat(
|
||||||
|
|||||||
Reference in New Issue
Block a user