"Fossies" - the Fresh Open Source Software Archive 
Member "flutter-3.7.0/examples/api/test/material/dialog/alert_dialog.1_test.dart" (24 Jan 2023, 949 Bytes) of package /linux/misc/flutter-3.7.0.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Dart source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
1 // Copyright 2014 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 import 'package:flutter/material.dart';
6 import 'package:flutter_api_samples/material/dialog/alert_dialog.1.dart' as example;
7 import 'package:flutter_test/flutter_test.dart';
8
9 void main() {
10 testWidgets('Show Alert dialog', (WidgetTester tester) async {
11 const String dialogTitle = 'AlertDialog Title';
12 await tester.pumpWidget(
13 const MaterialApp(
14 home: Scaffold(
15 body: example.MyApp(),
16 ),
17 ),
18 );
19
20 expect(find.text(dialogTitle), findsNothing);
21
22 await tester.tap(find.widgetWithText(TextButton, 'Show Dialog'));
23 await tester.pumpAndSettle();
24 expect(find.text(dialogTitle), findsOneWidget);
25
26 await tester.tap(find.text('OK'));
27 await tester.pumpAndSettle();
28 expect(find.text(dialogTitle), findsNothing);
29 });
30 }