File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed
examples/api/test/widgets/async Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -378,7 +378,6 @@ final Set<String> _knownMissingTests = <String>{
378
378
'examples/api/test/widgets/nested_scroll_view/nested_scroll_view_state.0_test.dart' ,
379
379
'examples/api/test/widgets/scroll_position/scroll_metrics_notification.0_test.dart' ,
380
380
'examples/api/test/widgets/media_query/media_query_data.system_gesture_insets.0_test.dart' ,
381
- 'examples/api/test/widgets/async/future_builder.0_test.dart' ,
382
381
'examples/api/test/widgets/animated_switcher/animated_switcher.0_test.dart' ,
383
382
'examples/api/test/widgets/animated_list/animated_list.0_test.dart' ,
384
383
'examples/api/test/widgets/focus_traversal/focus_traversal_group.0_test.dart' ,
Original file line number Diff line number Diff line change
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/widgets/async/future_builder.0.dart'
7
+ as example;
8
+ import 'package:flutter_test/flutter_test.dart' ;
9
+
10
+ void main () {
11
+ testWidgets ('StreamBuilder listens to internal stream' , (WidgetTester tester) async {
12
+ await tester.pumpWidget (
13
+ const example.FutureBuilderExampleApp (),
14
+ );
15
+
16
+ expect (find.byType (CircularProgressIndicator ), findsOne);
17
+ expect (find.text ('Awaiting result...' ), findsOne);
18
+
19
+ await tester.pump (const Duration (seconds: 1 ));
20
+
21
+ expect (find.byType (CircularProgressIndicator ), findsOne);
22
+ expect (find.text ('Awaiting result...' ), findsOne);
23
+
24
+ await tester.pump (const Duration (seconds: 1 ));
25
+
26
+ expect (find.byIcon (Icons .check_circle_outline), findsOne);
27
+ expect (find.text ('Result: Data Loaded' ), findsOne);
28
+ });
29
+ }
You can’t perform that action at this time.
0 commit comments