fix(llc): Fix unread count not updating when the current user is set.

Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
Sahil Kumar
2021-09-08 16:37:34 +05:30
committed by xsahil03x
parent 386df52048
commit f4e37e23d6
5 changed files with 44 additions and 14 deletions
@@ -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);
},
);
});
}