refactor(updates): pass typed runtime policy to deskup
This commit is contained in:
1 parent
1ef8edc8bc
commit
d83f94afd5
13 files changed
+158
-102
No files matched your search
@@ -0,0 +1,30 @@
|
||||
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');
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user