forked from eatvio/eatvio_app
feat(tests): updated tests coverage to 66.5%
This commit is contained in:
@@ -80,5 +80,35 @@ void main() {
|
||||
expect(model.weight, 80);
|
||||
expect(model.height, 175);
|
||||
});
|
||||
|
||||
test('toJson serializes RegistrationModel correctly', () {
|
||||
final model = RegistrationModel(
|
||||
firstName: 'John',
|
||||
lastName: 'Doe',
|
||||
email: 'john.doe@example.com',
|
||||
phone: '+1234567890',
|
||||
gender: 'male',
|
||||
password: 'password123',
|
||||
confirmPassword: 'password123',
|
||||
weight: 75,
|
||||
height: 180,
|
||||
activityCoefficient: 1.5,
|
||||
birthday: '1990-01-01',
|
||||
);
|
||||
|
||||
final json = model.toJson();
|
||||
|
||||
expect(json['first_name'], 'John');
|
||||
expect(json['last_name'], 'Doe');
|
||||
expect(json['email'], 'john.doe@example.com');
|
||||
expect(json['phone'], '+1234567890');
|
||||
expect(json['gender'], 'male');
|
||||
expect(json['password'], 'password123');
|
||||
expect(json['password_confirmation'], 'password123');
|
||||
expect(json['weight'], 75);
|
||||
expect(json['height'], 180);
|
||||
expect(json['activity_coefficient'], 1.5);
|
||||
expect(json['birthdate'], '1990-01-01');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user