forked from eatvio/eatvio_app
feat(tests): updated tests coverage to 66.5%
This commit is contained in:
29
test/features/auth/models/token_model_test.dart
Normal file
29
test/features/auth/models/token_model_test.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
import 'package:eatvio_app/features/auth/models/token_model.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
group('TokenModel', () {
|
||||
test('fromJson parses token correctly', () {
|
||||
final json = {'token': 'test-token-12345'};
|
||||
|
||||
final model = TokenModel.fromJson(json);
|
||||
|
||||
expect(model.token, 'test-token-12345');
|
||||
});
|
||||
|
||||
test('toJson serializes token correctly', () {
|
||||
const model = TokenModel(token: 'test-token-12345');
|
||||
|
||||
final json = model.toJson();
|
||||
|
||||
expect(json['token'], 'test-token-12345');
|
||||
});
|
||||
|
||||
test('creates instance with token', () {
|
||||
const model = TokenModel(token: 'another-token');
|
||||
|
||||
expect(model.token, 'another-token');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user