Merge branch 'develop' into hotfix/readIndicator

This commit is contained in:
Salvatore Giordano
2021-11-24 15:12:03 +01:00
committed by GitHub
8 changed files with 50 additions and 9 deletions
+1
View File
@@ -8,6 +8,7 @@
- `closeConnection()` now uses `normalClosure` status when closing websocket.
- Fixed local unread count indicator increasing for thread replies
- Fixed user presence indicator not updating correctly
## 3.2.0
@@ -179,5 +179,14 @@ class User extends Equatable {
);
@override
List<Object?> get props => [id, role];
List<Object?> get props => [
id,
role,
lastActive,
online,
extraData,
banned,
teams,
language,
];
}
@@ -70,13 +70,19 @@ void main() {
expect(
newReaction.extraData, {'updated_at': '2020-01-28T22:17:31.108742Z'});
final newUserCreateTime = DateTime.now();
newReaction = reaction.copyWith(
type: 'lol',
createdAt: DateTime.parse('2021-01-28T22:17:31.108742Z'),
extraData: {},
messageId: 'test',
score: 2,
user: User(id: 'test'),
user: User(
id: 'test',
createdAt: newUserCreateTime,
updatedAt: newUserCreateTime,
),
userId: 'test',
);
@@ -88,12 +94,21 @@ void main() {
expect(newReaction.extraData, {});
expect(newReaction.messageId, 'test');
expect(newReaction.score, 2);
expect(newReaction.user, User(id: 'test'));
expect(
newReaction.user,
User(
id: 'test',
createdAt: newUserCreateTime,
updatedAt: newUserCreateTime,
),
);
expect(newReaction.userId, 'test');
});
test('merge', () {
final reaction = Reaction.fromJson(jsonFixture('reaction.json'));
final newUserCreateTime = DateTime.now();
final newReaction = reaction.merge(
Reaction(
type: 'lol',
@@ -101,7 +116,11 @@ void main() {
extraData: {},
messageId: 'test',
score: 2,
user: User(id: 'test'),
user: User(
id: 'test',
createdAt: newUserCreateTime,
updatedAt: newUserCreateTime,
),
userId: 'test',
),
);
@@ -114,7 +133,14 @@ void main() {
expect(newReaction.extraData, {});
expect(newReaction.messageId, 'test');
expect(newReaction.score, 2);
expect(newReaction.user, User(id: 'test'));
expect(
newReaction.user,
User(
id: 'test',
createdAt: newUserCreateTime,
updatedAt: newUserCreateTime,
),
);
expect(newReaction.userId, 'test');
});
});