Skip to content

Commit 5c2c39b

Browse files
testAdd tests for stepper.controls_builder.0.dart (flutter#150669)
Contributes to flutter#130459 It adds a test for - `examples/api/lib/material/stepper/stepper.controls_builder.0.dart`
1 parent 8d01fe0 commit 5c2c39b

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

dev/bots/check_code_samples.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,6 @@ final Set<String> _knownMissingTests = <String>{
320320
'examples/api/test/material/color_scheme/dynamic_content_color.0_test.dart',
321321
'examples/api/test/material/platform_menu_bar/platform_menu_bar.0_test.dart',
322322
'examples/api/test/material/menu_anchor/menu_anchor.2_test.dart',
323-
'examples/api/test/material/stepper/stepper.controls_builder.0_test.dart',
324323
'examples/api/test/material/flexible_space_bar/flexible_space_bar.0_test.dart',
325324
'examples/api/test/material/chip/deletable_chip_attributes.on_deleted.0_test.dart',
326325
'examples/api/test/material/expansion_panel/expansion_panel_list.expansion_panel_list_radio.0_test.dart',
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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/stepper/stepper.controls_builder.0.dart' as example;
7+
import 'package:flutter_test/flutter_test.dart';
8+
9+
void main() {
10+
testWidgets('Stepper control builder can be overridden to display custom buttons', (WidgetTester tester) async {
11+
await tester.pumpWidget(
12+
const example.ControlsBuilderExampleApp(),
13+
);
14+
15+
expect(find.widgetWithText(AppBar, 'Stepper Sample'), findsOne);
16+
expect(find.text('A').hitTestable(), findsOne);
17+
expect(find.text('B').hitTestable(), findsOne);
18+
expect(find.widgetWithText(TextButton, 'NEXT').hitTestable(), findsOne);
19+
expect(find.widgetWithText(TextButton, 'CANCEL').hitTestable(), findsOne);
20+
});
21+
}

0 commit comments

Comments
 (0)