Files
pipelines/app/test/features/updates/native_update_dialog_test.dart
T

33 lines
1.0 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() {
testWidgets('desktop prompt identifies source and archive action', (
tester,
) async {
await tester.pumpWidget(
MaterialApp(
home: Builder(
builder: (context) => TextButton(
onPressed: () => showLaunchUpdateDialog(
context,
web: false,
cupertino: false,
nativePlatform: 'linux',
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('extract the archive'), findsOneWidget);
expect(find.text('Download'), findsOneWidget);
expect(find.textContaining('Android'), findsNothing);
});
}