Skip to content

Commit ad56b54

Browse files
Add test for standard_fab_location.0.dart (flutter#149225)
Contributes to flutter#130459 It adds a test for - `examples/api/lib/material/floating_action_button_location/standard_fab_location.0.dart`
1 parent 2a543aa commit ad56b54

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

dev/bots/check_code_samples.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,6 @@ final Set<String> _knownMissingTests = <String>{
323323
'examples/api/test/material/menu_anchor/menu_anchor.2_test.dart',
324324
'examples/api/test/material/stepper/stepper.controls_builder.0_test.dart',
325325
'examples/api/test/material/flexible_space_bar/flexible_space_bar.0_test.dart',
326-
'examples/api/test/material/floating_action_button_location/standard_fab_location.0_test.dart',
327326
'examples/api/test/material/chip/deletable_chip_attributes.on_deleted.0_test.dart',
328327
'examples/api/test/material/icon_button/icon_button.3_test.dart',
329328
'examples/api/test/material/expansion_panel/expansion_panel_list.expansion_panel_list_radio.0_test.dart',
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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/floating_action_button_location/standard_fab_location.0.dart'
7+
as example;
8+
import 'package:flutter_test/flutter_test.dart';
9+
10+
void main() {
11+
testWidgets('The FloatingActionButton should have a right padding', (WidgetTester tester) async {
12+
await tester.pumpWidget(
13+
const example.StandardFabLocationExampleApp(),
14+
);
15+
16+
expect(find.widgetWithIcon(FloatingActionButton, Icons.add), findsOne);
17+
final double right = tester.getCenter(find.byType(FloatingActionButton)).dx;
18+
expect(right, closeTo(706, 1));
19+
});
20+
}

0 commit comments

Comments
 (0)