Files
pipelines/app/test/features/updates/launch_update_test.dart
T
alan 277c691b2c Install Linux updates in place and restart
The Linux app now downloads the release archive to a temporary folder,
verifies its checksum, extracts it beside the install folder, swaps the
bundle in with two renames (keeping <install>.previous for rollback) and
relaunches. A read-only install location is reported with how to fix it.
The prompt and Settings button say "Install and restart".
2026-11-09 19:40:52 +00:00

42 lines
1.2 KiB
Dart

import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/features/updates/app_updates.dart';
import 'package:pipelines_app/features/updates/launch_update.dart';
void main() {
test('web compares release identity and ignores Android metadata', () {
expect(
webUpdateFor(
'web-current',
'{"schema":1,"platform":"web","buildId":"web-current"}',
),
isNull,
);
expect(
webUpdateFor(
'web-current',
'{"schema":1,"platform":"web","buildId":"web-new"}',
),
isA<WebLaunchUpdate>(),
);
expect(
webUpdateFor(
'web-current',
'{"schema":1,"platform":"android","buildId":"web-new"}',
),
isNull,
);
expect(webUpdateFor('', '{"buildId":"web-new"}'), isNull);
});
test('Android compares version code and never prompts for an older feed', () {
final update = AppUpdate(
versionCode: 8,
versionName: '8',
apk: Uri.parse('https://example.test/app.apk'),
);
expect(androidUpdateFor(update, 7), isA<AndroidLaunchUpdate>());
expect(androidUpdateFor(update, 8), isNull);
expect(androidUpdateFor(update, null), isNull);
});
}