forked from eatvio/eatvio_app
30 lines
730 B
Dart
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');
|
|
});
|
|
});
|
|
}
|
|
|