File tree Expand file tree Collapse file tree 3 files changed +46
-2
lines changed
examples/api/test/material/banner Expand file tree Collapse file tree 3 files changed +46
-2
lines changed Original file line number Diff line number Diff line change @@ -363,8 +363,6 @@ final Set<String> _knownMissingTests = <String>{
363363 'examples/api/test/material/segmented_button/segmented_button.0_test.dart' ,
364364 'examples/api/test/material/app_bar/sliver_app_bar.2_test.dart' ,
365365 'examples/api/test/material/app_bar/sliver_app_bar.3_test.dart' ,
366- 'examples/api/test/material/banner/material_banner.1_test.dart' ,
367- 'examples/api/test/material/banner/material_banner.0_test.dart' ,
368366 'examples/api/test/material/navigation_rail/navigation_rail.extended_animation.0_test.dart' ,
369367 'examples/api/test/rendering/growth_direction/growth_direction.0_test.dart' ,
370368 'examples/api/test/rendering/sliver_grid/sliver_grid_delegate_with_fixed_cross_axis_count.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/material/banner/material_banner.0.dart' as example;
7+ import 'package:flutter_test/flutter_test.dart' ;
8+
9+ void main () {
10+ testWidgets ('BottomNavigationBar Updates Screen Content' , (WidgetTester tester) async {
11+ await tester.pumpWidget (
12+ const example.MaterialBannerExampleApp (),
13+ );
14+
15+ expect (find.byType (MaterialBanner ), findsOne);
16+ expect (find.text ('Hello, I am a Material Banner' ), findsOne);
17+ expect (find.byIcon (Icons .agriculture_outlined), findsOne);
18+ expect (find.widgetWithText (TextButton , 'OPEN' ), findsOne);
19+ expect (find.widgetWithText (TextButton , 'DISMISS' ), findsOne);
20+ });
21+ }
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/banner/material_banner.1.dart' as example;
7+ import 'package:flutter_test/flutter_test.dart' ;
8+
9+ void main () {
10+ testWidgets ('BottomNavigationBar Updates Screen Content' , (WidgetTester tester) async {
11+ await tester.pumpWidget (
12+ const example.MaterialBannerExampleApp (),
13+ );
14+
15+ expect (find.byType (MaterialBanner ), findsNothing);
16+ await tester.tap (find.widgetWithText (ElevatedButton , 'Show MaterialBanner' ));
17+ await tester.pumpAndSettle ();
18+
19+ expect (find.byType (MaterialBanner ), findsOne);
20+ expect (find.text ('Hello, I am a Material Banner' ), findsOne);
21+ expect (find.byIcon (Icons .agriculture_outlined), findsOne);
22+ expect (find.widgetWithText (TextButton , 'DISMISS' ), findsOne);
23+
24+ });
25+ }
You can’t perform that action at this time.
0 commit comments