Merge pull request #669 from GetStream/fix/client-unread-count

fix(llc): Fix unread count not updating when the current user is set.
This commit is contained in:
Salvatore Giordano
2021-09-09 09:41:08 +02:00
committed by GitHub
5 changed files with 50 additions and 16 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);
},
);
});
}