test(llc): fix user, own_user tests

Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
Sahil Kumar
2022-05-20 15:43:40 +05:30
committed by xsahil03x
parent 180e4475d2
commit 89a3d09478
3 changed files with 13 additions and 5 deletions
@@ -41,7 +41,8 @@ class OwnUser extends User {
factory OwnUser.fromUser(User user) => OwnUser(
id: user.id,
role: user.role,
name: user.name,
// Using extraData value in order to not use id as name.
name: user.extraData['name'] as String?,
image: user.image,
createdAt: user.createdAt,
updatedAt: user.updatedAt,
@@ -78,7 +79,10 @@ class OwnUser extends User {
OwnUser(
id: id ?? this.id,
role: role ?? this.role,
name: name ?? extraData?['name'] as String? ?? this.name,
name: name ??
extraData?['name'] as String? ??
// Using extraData value in order to not use id as name.
this.extraData['name'] as String?,
image: image ?? extraData?['image'] as String? ?? this.image,
banned: banned ?? this.banned,
banExpires: banExpires ?? this.banExpires,
@@ -103,7 +107,8 @@ class OwnUser extends User {
return copyWith(
id: other.id,
role: other.role,
name: other.name,
// Using extraData value in order to not use id as name.
name: other.extraData['name'] as String?,
image: other.image,
banned: other.banned,
channelMutes: other.channelMutes,
@@ -172,7 +172,10 @@ class User extends Equatable {
User(
id: id ?? this.id,
role: role ?? this.role,
name: name ?? extraData?['name'] as String? ?? this.name,
name: name ??
extraData?['name'] as String? ??
// Using extraData value in order to not use id as name.
this.extraData['name'] as String?,
image: image ?? extraData?['image'] as String? ?? this.image,
createdAt: createdAt ?? this.createdAt,
updatedAt: updatedAt ?? this.updatedAt,
@@ -2514,7 +2514,7 @@ void main() {
});
test(
'''setting the `currentUser` should also compute and update the unreadCounts''',
'setting the `currentUser` should also compute and update the unreadCounts',
() {
final state = client.state;
final initialUser = OwnUser.fromUser(user);