Files
eatvio_app/test/features/auth/models/token_model_test.dart
2026-01-14 18:47:11 +03:00

30 lines
730 B
Dart

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');
});
});
}