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

34 lines
776 B
Dart
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import 'package:eatvio_app/features/chat/models/chat_meta_model.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
group('ChatMetaModel', () {
test('создает ChatMetaModel с правильными значениями', () {
const model = ChatMetaModel(
lastPage: 5,
);
expect(model.lastPage, 5);
});
test('fromJson создает ChatMetaModel из JSON', () {
final json = {
'last_page': 5,
};
final model = ChatMetaModel.fromJson(json);
expect(model.lastPage, 5);
});
test('toJson serializes ChatMetaModel correctly', () {
const model = ChatMetaModel(lastPage: 5);
final json = model.toJson();
expect(json['last_page'], 5);
});
});
}