File tree 2 files changed +30
-1
lines changed
examples/api/test/widgets/inherited_theme
2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -372,7 +372,6 @@ final Set<String> _knownMissingTests = <String>{
372
372
'examples/api/test/widgets/focus_manager/focus_node.unfocus.0_test.dart' ,
373
373
'examples/api/test/widgets/framework/build_owner.0_test.dart' ,
374
374
'examples/api/test/widgets/framework/error_widget.0_test.dart' ,
375
- 'examples/api/test/widgets/inherited_theme/inherited_theme.0_test.dart' ,
376
375
'examples/api/test/widgets/autofill/autofill_group.0_test.dart' ,
377
376
'examples/api/test/widgets/nested_scroll_view/nested_scroll_view_state.0_test.dart' ,
378
377
'examples/api/test/widgets/scroll_position/scroll_metrics_notification.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/inherited_theme/inherited_theme.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.InheritedThemeExampleApp (),
14
+ );
15
+
16
+ expect (find.byType (GestureDetector ), findsOne);
17
+ expect (find.text ('Tap Here' ), findsOne);
18
+
19
+ final DefaultTextStyle bodyDefaultTextStyle = DefaultTextStyle .of (tester.element (find.text ('Tap Here' )));
20
+ expect (bodyDefaultTextStyle.style, const TextStyle (fontSize: 48 , color: Colors .blue));
21
+
22
+ await tester.tap (find.text ('Tap Here' ));
23
+ await tester.pumpAndSettle ();
24
+
25
+ expect (find.text ('Hello World' ), findsOne);
26
+
27
+ final DefaultTextStyle routeDefaultTextStyle = DefaultTextStyle .of (tester.element (find.text ('Hello World' )));
28
+ expect (routeDefaultTextStyle.style, const TextStyle (fontSize: 48 , color: Colors .blue));
29
+ });
30
+ }
You can’t perform that action at this time.
0 commit comments