add more user and channel config test
This commit is contained in:
+2
-1
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"id": "bbb19d9a-ee50-45bc-84e5-0584e79d0c9e",
|
||||
"role": "test-role"
|
||||
"role": "test-role",
|
||||
"name": "John"
|
||||
}
|
||||
@@ -8,6 +8,7 @@ void main() {
|
||||
test('should parse json correctly', () {
|
||||
final user = User.fromJson(jsonFixture('user.json'));
|
||||
expect(user.id, 'bbb19d9a-ee50-45bc-84e5-0584e79d0c9e');
|
||||
expect(user.name, 'John');
|
||||
});
|
||||
|
||||
test('should serialize to json correctly', () {
|
||||
@@ -20,5 +21,26 @@ void main() {
|
||||
'id': 'bbb19d9a-ee50-45bc-84e5-0584e79d0c9e',
|
||||
});
|
||||
});
|
||||
|
||||
test('copyWith', () {
|
||||
final user = User.fromJson(jsonFixture('user.json'));
|
||||
var newUser = user.copyWith();
|
||||
|
||||
expect(newUser.id, user.id);
|
||||
expect(newUser.role, user.role);
|
||||
expect(newUser.name, user.name);
|
||||
|
||||
newUser = user.copyWith(
|
||||
id: 'test',
|
||||
role: 'test',
|
||||
extraData: {
|
||||
'name': 'test',
|
||||
},
|
||||
);
|
||||
|
||||
expect(newUser.id, 'test');
|
||||
expect(newUser.role, 'test');
|
||||
expect(newUser.name, 'test');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user