forked from eatvio/eatvio_app
chore(dependencies): add webview_flutter_platform_interface package to pubspec.yaml and clean up test files by removing unnecessary whitespace
This commit is contained in:
@@ -3,24 +3,57 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
group('PassKeyParams', () {
|
||||
test('создает PassKeyParams с правильными значениями', () {
|
||||
final model = PassKeyParams(
|
||||
routeName: '/profile',
|
||||
routeParams: {'id': 1},
|
||||
test('creates PassKeyParams with routeName and routeParams', () {
|
||||
final params = PassKeyParams(
|
||||
routeName: '/home',
|
||||
routeParams: {'id': '123', 'name': 'test'},
|
||||
);
|
||||
|
||||
expect(model.routeName, '/profile');
|
||||
expect(model.routeParams, {'id': 1});
|
||||
expect(params.routeName, '/home');
|
||||
expect(params.routeParams, {'id': '123', 'name': 'test'});
|
||||
});
|
||||
|
||||
test('создает PassKeyParams без routeParams', () {
|
||||
final model = PassKeyParams(
|
||||
test('creates PassKeyParams with null routeParams', () {
|
||||
final params = PassKeyParams(
|
||||
routeName: '/profile',
|
||||
routeParams: null,
|
||||
);
|
||||
|
||||
expect(model.routeParams, isNull);
|
||||
expect(params.routeName, '/profile');
|
||||
expect(params.routeParams, null);
|
||||
});
|
||||
|
||||
test('creates PassKeyParams from JSON with routeParams', () {
|
||||
final json = {
|
||||
'route_name': '/details',
|
||||
'route_params': {'id': '456', 'type': 'recipe'},
|
||||
};
|
||||
|
||||
final params = PassKeyParams.fromJson(json);
|
||||
|
||||
expect(params.routeName, '/details');
|
||||
expect(params.routeParams, {'id': '456', 'type': 'recipe'});
|
||||
});
|
||||
|
||||
test('creates PassKeyParams from JSON without routeParams', () {
|
||||
final json = {
|
||||
'route_name': '/settings',
|
||||
};
|
||||
|
||||
final params = PassKeyParams.fromJson(json);
|
||||
|
||||
expect(params.routeName, '/settings');
|
||||
expect(params.routeParams, null);
|
||||
});
|
||||
|
||||
test('creates PassKeyParams with empty routeParams', () {
|
||||
final params = PassKeyParams(
|
||||
routeName: '/empty',
|
||||
routeParams: {},
|
||||
);
|
||||
|
||||
expect(params.routeName, '/empty');
|
||||
expect(params.routeParams, {});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user