Skip to content

Commit ce44ac9

Browse files
[material_ui] Unskip 5 passing web tests in bottom_app_bar_test and text_field_test (flutter#12983)
Unskips 5 tests across 2 `material_ui` test files that were previously skipped on the web (`skip: isBrowser`) due to issues that have since been resolved (support for `Path.combine` custom shapes and `StrutStyle` in CanvasKit/Skwasm): - `packages/material_ui/test/bottom_app_bar_test.dart`: Unskips 2 custom shape golden tests (flutter#44572 — closed; verified 99.8% pixel match locally on Chrome against the Linux Skia Gold baseline) - `packages/material_ui/test/text_field_test.dart`: Unskips 3 strut style tests (flutter#32243 — closed) Split out from flutter#193171 per flutter#188444. ## Pre-Review Checklist
1 parent 30a8254 commit ce44ac9

2 files changed

Lines changed: 53 additions & 65 deletions

File tree

‎packages/material_ui/test/bottom_app_bar_test.dart‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ void main() {
125125
await pump(FloatingActionButtonLocation.centerDocked);
126126
await tester.pumpAndSettle();
127127
await expectLater(find.byKey(key), matchesGoldenFile('m2_bottom_app_bar.custom_shape.2.png'));
128-
}, skip: isBrowser); // https://github.com/flutter/flutter/issues/44572
128+
});
129129

130130
testWidgets('Material3 - Custom shape', (WidgetTester tester) async {
131131
final Key key = UniqueKey();
@@ -163,7 +163,7 @@ void main() {
163163
await pump(FloatingActionButtonLocation.centerDocked);
164164
await tester.pumpAndSettle();
165165
await expectLater(find.byKey(key), matchesGoldenFile('m3_bottom_app_bar.custom_shape.2.png'));
166-
}, skip: isBrowser); // https://github.com/flutter/flutter/issues/44572
166+
});
167167

168168
testWidgets('Custom Padding', (WidgetTester tester) async {
169169
const customPadding = EdgeInsets.all(10);

‎packages/material_ui/test/text_field_test.dart‎

Lines changed: 51 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -14263,81 +14263,69 @@ void main() {
1426314263
);
1426414264
});
1426514265

14266-
testWidgets(
14267-
'strut no force large strut',
14268-
(WidgetTester tester) async {
14269-
await tester.pumpWidget(
14270-
MaterialApp(
14271-
theme: ThemeData(platform: TargetPlatform.android, useMaterial3: false),
14272-
home: const Material(
14273-
child: Center(child: TextField(maxLines: 6, strutStyle: StrutStyle(fontSize: 25))),
14274-
),
14266+
testWidgets('strut no force large strut', (WidgetTester tester) async {
14267+
await tester.pumpWidget(
14268+
MaterialApp(
14269+
theme: ThemeData(platform: TargetPlatform.android, useMaterial3: false),
14270+
home: const Material(
14271+
child: Center(child: TextField(maxLines: 6, strutStyle: StrutStyle(fontSize: 25))),
1427514272
),
14276-
);
14273+
),
14274+
);
1427714275

14278-
expect(
14279-
tester.getSize(find.byType(TextField)),
14280-
// When the strut's height is larger than TextStyle's and forceStrutHeight
14281-
// is disabled, then the StrutStyle takes precedence.
14282-
const Size(800, 174),
14283-
);
14284-
},
14285-
skip: isBrowser, // TODO(mdebbar): https://github.com/flutter/flutter/issues/32243
14286-
);
14276+
expect(
14277+
tester.getSize(find.byType(TextField)),
14278+
// When the strut's height is larger than TextStyle's and forceStrutHeight
14279+
// is disabled, then the StrutStyle takes precedence.
14280+
const Size(800, 174),
14281+
);
14282+
});
1428714283

14288-
testWidgets(
14289-
'strut height override',
14290-
(WidgetTester tester) async {
14291-
await tester.pumpWidget(
14292-
MaterialApp(
14293-
theme: ThemeData(platform: TargetPlatform.android, useMaterial3: false),
14294-
home: const Material(
14295-
child: Center(
14296-
child: TextField(
14297-
maxLines: 3,
14298-
strutStyle: StrutStyle(fontSize: 8, forceStrutHeight: true),
14299-
),
14284+
testWidgets('strut height override', (WidgetTester tester) async {
14285+
await tester.pumpWidget(
14286+
MaterialApp(
14287+
theme: ThemeData(platform: TargetPlatform.android, useMaterial3: false),
14288+
home: const Material(
14289+
child: Center(
14290+
child: TextField(
14291+
maxLines: 3,
14292+
strutStyle: StrutStyle(fontSize: 8, forceStrutHeight: true),
1430014293
),
1430114294
),
1430214295
),
14303-
);
14296+
),
14297+
);
1430414298

14305-
expect(
14306-
tester.getSize(find.byType(TextField)),
14307-
// The smaller font size of strut make the field shorter than normal.
14308-
const Size(800, 48),
14309-
);
14310-
},
14311-
skip: isBrowser, // TODO(mdebbar): https://github.com/flutter/flutter/issues/32243
14312-
);
14299+
expect(
14300+
tester.getSize(find.byType(TextField)),
14301+
// The smaller font size of strut make the field shorter than normal.
14302+
const Size(800, 48),
14303+
);
14304+
});
1431314305

14314-
testWidgets(
14315-
'strut forces field taller',
14316-
(WidgetTester tester) async {
14317-
await tester.pumpWidget(
14318-
MaterialApp(
14319-
theme: ThemeData(platform: TargetPlatform.android, useMaterial3: false),
14320-
home: const Material(
14321-
child: Center(
14322-
child: TextField(
14323-
maxLines: 3,
14324-
style: TextStyle(fontSize: 10),
14325-
strutStyle: StrutStyle(fontSize: 18, forceStrutHeight: true),
14326-
),
14306+
testWidgets('strut forces field taller', (WidgetTester tester) async {
14307+
await tester.pumpWidget(
14308+
MaterialApp(
14309+
theme: ThemeData(platform: TargetPlatform.android, useMaterial3: false),
14310+
home: const Material(
14311+
child: Center(
14312+
child: TextField(
14313+
maxLines: 3,
14314+
style: TextStyle(fontSize: 10),
14315+
strutStyle: StrutStyle(fontSize: 18, forceStrutHeight: true),
1432714316
),
1432814317
),
1432914318
),
14330-
);
14319+
),
14320+
);
1433114321

14332-
expect(
14333-
tester.getSize(find.byType(TextField)),
14334-
// When the strut fontSize is larger than a provided TextStyle, the
14335-
// strut's height takes precedence.
14336-
const Size(800, 78),
14337-
);
14338-
},
14339-
skip: isBrowser, // TODO(mdebbar): https://github.com/flutter/flutter/issues/32243
14340-
);
14322+
expect(
14323+
tester.getSize(find.byType(TextField)),
14324+
// When the strut fontSize is larger than a provided TextStyle, the
14325+
// strut's height takes precedence.
14326+
const Size(800, 78),
14327+
);
14328+
});
1434114329

1434214330
testWidgets('Caret center position', (WidgetTester tester) async {
1434314331
await tester.pumpWidget(

0 commit comments

Comments
 (0)