fix(llc): Fix unread count not updating when the current user is set.
Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
@@ -2313,5 +2313,27 @@ void main() {
|
||||
)).called(1);
|
||||
verifyNoMoreInteractions(api.message);
|
||||
});
|
||||
|
||||
test(
|
||||
'''setting the `currentUser` should also compute and update the unreadCounts''',
|
||||
() {
|
||||
final state = client.state;
|
||||
final initialUser = OwnUser.fromUser(user);
|
||||
|
||||
expect(state.currentUser, initialUser);
|
||||
expect(state.totalUnreadCount, 0);
|
||||
expect(state.unreadChannels, 0);
|
||||
|
||||
final updateUser = initialUser.copyWith(
|
||||
totalUnreadCount: 33,
|
||||
unreadChannels: 33,
|
||||
);
|
||||
state.currentUser = updateUser;
|
||||
|
||||
expect(state.currentUser, updateUser);
|
||||
expect(state.totalUnreadCount, 33);
|
||||
expect(state.unreadChannels, 33);
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user