31 lines
1.0 KiB
Dart
31 lines
1.0 KiB
Dart
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:cutdex/integrations/app_update_configuration.dart';
|
|
|
|
void main() {
|
|
test('production ignores development source overrides', () {
|
|
final config = windowsUpdateConfiguration(
|
|
flavor: 'production',
|
|
developmentUrl: 'http://127.0.0.1:8765',
|
|
developmentSource: 'web',
|
|
allowLocalHttp: true,
|
|
)!;
|
|
final map = config.toMap();
|
|
expect(
|
|
(map['source'] as Map)['url'],
|
|
'https://git.orangraph.com/lingjhf/cutdex',
|
|
);
|
|
expect(map['expectedPackageId'], 'Cutdex');
|
|
});
|
|
test('development requires opt-in and uses an isolated identity', () {
|
|
expect(windowsUpdateConfiguration(flavor: 'development'), isNull);
|
|
final map = windowsUpdateConfiguration(
|
|
flavor: 'development',
|
|
developmentUrl: 'http://127.0.0.1:8765',
|
|
developmentSource: 'web',
|
|
allowLocalHttp: true,
|
|
)!.toMap();
|
|
expect(map['expectedPackageId'], 'Cutdex.Dev');
|
|
expect((map['source'] as Map)['type'], 'web');
|
|
});
|
|
}
|