fix tests
This commit is contained in:
@@ -128,7 +128,7 @@ class ChannelPreview extends StatelessWidget {
|
|||||||
stream: channel.state.messagesStream,
|
stream: channel.state.messagesStream,
|
||||||
initialData: channel.state.messages,
|
initialData: channel.state.messages,
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
final lastMessage = snapshot.data.lastWhere((m) => m.shadowed != true);
|
final lastMessage = snapshot.data?.lastWhere((m) => m.shadowed != true);
|
||||||
if (lastMessage == null) {
|
if (lastMessage == null) {
|
||||||
return SizedBox();
|
return SizedBox();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,11 @@ void main() {
|
|||||||
'name': 'test name',
|
'name': 'test name',
|
||||||
});
|
});
|
||||||
when(channelState.unreadCount).thenReturn(1);
|
when(channelState.unreadCount).thenReturn(1);
|
||||||
|
when(channelState.messages).thenReturn([
|
||||||
|
Message(
|
||||||
|
text: 'hello',
|
||||||
|
)
|
||||||
|
]);
|
||||||
when(channelState.lastMessage).thenReturn(Message(
|
when(channelState.lastMessage).thenReturn(Message(
|
||||||
text: 'hello',
|
text: 'hello',
|
||||||
));
|
));
|
||||||
|
|||||||
Reference in New Issue
Block a user