Fix duplicate MaterialApp in api example test (#154550)

This PR fixes two tests that created a nested `MaterialApp` (and it simplifies another test).
This commit is contained in:
Bruno Leroux 2024-09-04 08:38:33 +02:00 committed by GitHub
parent 6caae154a9
commit dce20c97dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 13 deletions

View File

@ -25,11 +25,7 @@ void main() {
'FilterChip displays the correct border when selected',
(WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
body: example.MaterialStateBorderSideExampleApp(),
),
),
const example.MaterialStateBorderSideExampleApp(),
);
expect(findBorderColor(Colors.red), findsOne);
@ -40,11 +36,7 @@ void main() {
'FilterChip displays the correct border when not selected',
(WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
body: example.MaterialStateBorderSideExampleApp(),
),
),
const example.MaterialStateBorderSideExampleApp(),
);
await tester.tap(find.byType(FilterChip));

View File

@ -9,9 +9,7 @@ import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('Tapping FAB increments counter', (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: example.ValueListenableBuilderExample(),
),
const example.ValueListenableBuilderExampleApp(),
);
String getCount() {