add more user and channel config test

This commit is contained in:
Salvatore Giordano
2021-06-17 10:01:46 +02:00
parent aef63f3722
commit 91907639ad
4 changed files with 25 additions and 24 deletions
@@ -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');
});
});
}