feat(tests): updated tests coverage to 66.5%

This commit is contained in:
misha
2026-01-14 18:47:11 +03:00
parent 497ff19cfa
commit 13ccf56df0
102 changed files with 10146 additions and 379 deletions

View File

@@ -123,5 +123,50 @@ void main() {
expect(model.hasHypo, 1);
expect(model.hasHyper, 0);
});
test('toJson serializes UserRegistrationSheet correctly', () {
const model = UserRegistrationSheet(
firstName: 'John',
lastName: 'Doe',
email: 'john.doe@example.com',
password: 'password123',
passwordConfirmation: 'password123',
termsAccepted: 'accepted',
birthdate: '1990-01-01',
gender: 'male',
location: 'New York',
responseBody: '{}',
lang: 'en',
weight: 75,
height: 180,
phone: '+1234567890',
chestCircumference: 100,
waistCircumference: 80,
hipCircumference: 90,
bloodPressureUp: 120,
bloodPressureDown: 80,
hasHypo: 0,
hasHyper: 0,
aboutAllergy: 'None',
aboutTakingPils: 'None',
aboutSportHobbies: 'Running',
favoriteFoods: 'Pizza',
unfavoriteFoods: 'Broccoli',
additionalInfo: 'No additional info',
activityCoefficient: 1.5,
);
final json = model.toJson();
expect(json['first_name'], 'John');
expect(json['last_name'], 'Doe');
expect(json['email'], 'john.doe@example.com');
expect(json['password'], 'password123');
expect(json['password_confirmation'], 'password123');
expect(json['terms'], 'accepted');
expect(json['weight'], 75);
expect(json['height'], 180);
expect(json['activity_coefficient'], 1.5);
});
});
}