File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed
examples/api/test/material/radio Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -339,7 +339,6 @@ final Set<String> _knownMissingTests = <String>{
339
339
'examples/api/test/material/text_form_field/text_form_field.1_test.dart' ,
340
340
'examples/api/test/material/scrollbar/scrollbar.1_test.dart' ,
341
341
'examples/api/test/material/dropdown_menu/dropdown_menu.1_test.dart' ,
342
- 'examples/api/test/material/radio/radio.toggleable.0_test.dart' ,
343
342
'examples/api/test/material/search_anchor/search_anchor.0_test.dart' ,
344
343
'examples/api/test/material/search_anchor/search_anchor.1_test.dart' ,
345
344
'examples/api/test/material/search_anchor/search_anchor.2_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/material/radio/radio.toggleable.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.ToggleableExampleApp (),
14
+ );
15
+
16
+ expect (find.byType (Radio <int >), findsExactly (5 ));
17
+ expect (find.text ('Hercules Mulligan' ), findsOne);
18
+ expect (find.text ('Eliza Hamilton' ), findsOne);
19
+ expect (find.text ('Philip Schuyler' ), findsOne);
20
+ expect (find.text ('Maria Reynolds' ), findsOne);
21
+ expect (find.text ('Samuel Seabury' ), findsOne);
22
+
23
+ for (int i = 0 ; i < 5 ; i++ ) {
24
+ await tester.tap (find.byType (Radio <int >).at (i));
25
+ await tester.pump ();
26
+ expect (
27
+ find.byWidgetPredicate ((Widget widget) => widget is Radio <int > && widget.groupValue == i),
28
+ findsExactly (5 ),
29
+ );
30
+ }
31
+ });
32
+ }
You can’t perform that action at this time.
0 commit comments