Remove double MaterialApp wrap from api samples (#150055)
The widget under test already contains a MaterialApp, so there's no need to wrap it again with one in the test. In fact, the additional MaterialApp could hide problems in the widget under test.
This commit is contained in:
committed by
GitHub
parent
1f93809ad2
commit
962ae8a334
@@ -2,18 +2,13 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_api_samples/material/dropdown/dropdown_button.0.dart' as example;
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('Select an item from DropdownButton', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const MaterialApp(
|
||||
home: Scaffold(
|
||||
body: example.DropdownButtonApp(),
|
||||
),
|
||||
),
|
||||
const example.DropdownButtonApp(),
|
||||
);
|
||||
|
||||
expect(find.text('One'), findsOneWidget);
|
||||
|
||||
@@ -2,18 +2,13 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_api_samples/material/dropdown/dropdown_button.selected_item_builder.0.dart' as example;
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('Select an item from DropdownButton', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const MaterialApp(
|
||||
home: Scaffold(
|
||||
body: example.DropdownButtonApp(),
|
||||
),
|
||||
),
|
||||
const example.DropdownButtonApp(),
|
||||
);
|
||||
|
||||
expect(find.text('NYC'), findsOneWidget);
|
||||
|
||||
@@ -2,18 +2,13 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_api_samples/material/dropdown/dropdown_button.style.0.dart' as example;
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('Select an item from DropdownButton', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const MaterialApp(
|
||||
home: Scaffold(
|
||||
body: example.DropdownButtonApp(),
|
||||
),
|
||||
),
|
||||
const example.DropdownButtonApp(),
|
||||
);
|
||||
|
||||
expect(find.text('One'), findsOneWidget);
|
||||
|
||||
Reference in New Issue
Block a user