mirror of
https://github.com/rzuasti/oott.git
synced 2026-07-08 19:21:54 +02:00
27 lines
646 B
Dart
27 lines
646 B
Dart
import 'package:flutter_test/flutter_test.dart';
|
|||
|
|
import 'package:frontend/utils/oott_api.dart';
|
||
|
|
import 'package:http_mock_adapter/http_mock_adapter.dart';
|
||
|
|
|
||
|
|
import '../helpers/backend_test_harness.dart';
|
||
|
|
|
||
|
|
void main() {
|
||
|
|
late DioAdapter adapter;
|
||
|
|
|
||
|
|
setUp(() async {
|
||
|
|
adapter = await setUpBackendForTest();
|
||
|
|
});
|
||
|
|
|
||
|
|
test('getConfig GETs /config and decodes the notification method', () async {
|
||
|
|
adapter.onGet(
|
||
|
|
'/config',
|
||
|
|
(server) => server.reply(200, {
|
||
|
|
'notifications': {'method': 'push'},
|
||
|
|
}),
|
||
|
|
);
|
||
|
|
|
||
|
|
final config = await BackendAPI.instance.getConfig();
|
||
|
|
|
||
|
|
expect(config.notificationMethod, 'push');
|
||
|
|
});
|
||
|
|
}
|