277c691b2c
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".
38 lines
1.2 KiB
Dart
38 lines
1.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:pipelines_app/features/updates/launch_update_dialog.dart';
|
|
|
|
void main() {
|
|
for (final (platform, sentence, action) in [
|
|
('linux', 'installs it and restarts', 'Install and restart'),
|
|
('macos', 'extract the archive', 'Download'),
|
|
]) {
|
|
testWidgets('$platform prompt identifies source and its action', (
|
|
tester,
|
|
) async {
|
|
await tester.pumpWidget(
|
|
MaterialApp(
|
|
home: Builder(
|
|
builder: (context) => TextButton(
|
|
onPressed: () => showLaunchUpdateDialog(
|
|
context,
|
|
web: false,
|
|
cupertino: false,
|
|
nativePlatform: platform,
|
|
sourceName: 'Home Linux',
|
|
),
|
|
child: const Text('Check'),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
await tester.tap(find.text('Check'));
|
|
await tester.pumpAndSettle();
|
|
expect(find.textContaining('from Home Linux'), findsOneWidget);
|
|
expect(find.textContaining(sentence), findsOneWidget);
|
|
expect(find.text(action), findsOneWidget);
|
|
expect(find.textContaining('Android'), findsNothing);
|
|
});
|
|
}
|
|
}
|