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