Skip to content

Commit b5a6ea8

Browse files
[Infrastructure] - Add test platform suffixed by default (Resolves #2274) (#2540)
1 parent 775cb4a commit b5a6ea8

9 files changed

+35
-47
lines changed

super_editor/test/super_editor/mobile/super_editor_ios_swipe_to_pop_test.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ import '../supereditor_test_tools.dart';
99

1010
void main() {
1111
group('SuperEditor', () {
12-
testWidgetsOnIos('keeps current selection and does not show mobile controls when swipping to pop (on iOS)',
13-
(tester) async {
12+
testWidgetsOnIos('keeps current selection and does not show mobile controls when swipping to pop', (tester) async {
1413
// Run the test with a fixed size so we know how much we need to swipe
1514
// to pop the page.
1615
tester.view

super_editor/test/super_editor/supereditor_content_insertion_test.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,7 @@ Second paragraph"""). //
491491
);
492492
});
493493

494-
testWidgetsOnAndroid(
495-
'when the user presses the newline button on the software keyboard at the end of an image (on Android)',
494+
testWidgetsOnAndroid('when the user presses the newline button on the software keyboard at the end of an image',
496495
(tester) async {
497496
final testContext = await tester
498497
.createDocument()

super_editor/test/super_editor/supereditor_gestures_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ spans multiple lines.''',
458458
);
459459
});
460460

461-
testWidgetsOnAndroid('configures default gesture mode (on Android)', (tester) async {
461+
testWidgetsOnAndroid('configures default gesture mode', (tester) async {
462462
await tester //
463463
.createDocument()
464464
.withSingleParagraph()

super_editor/test/super_editor/supereditor_scrolling_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ void main() {
292292
);
293293
});
294294

295-
testWidgetsOnAndroid("auto-scrolls to caret position when dragging the spacebar (on Android)", (tester) async {
295+
testWidgetsOnAndroid("auto-scrolls to caret position when dragging the spacebar", (tester) async {
296296
// Pump an editor with a size that will cause it to be scrollable.
297297
const windowSize = Size(800, 400);
298298
tester.view.physicalSize = windowSize;

super_editor/test/super_editor/text_entry/links_test.dart

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,7 @@ void main() {
155155
expect((textContext.document.getNodeAt(1)! as ParagraphNode).text.toPlainText(), "after link");
156156
});
157157

158-
testWidgetsOnAndroid(
159-
'when pressing the newline button on the software keyboard at the end of a paragraph (on Android)',
158+
testWidgetsOnAndroid('when pressing the newline button on the software keyboard at the end of a paragraph',
160159
(tester) async {
161160
final textContext = await tester //
162161
.createDocument()
@@ -207,8 +206,7 @@ void main() {
207206
expect((textContext.document.getNodeAt(1)! as ParagraphNode).text.toPlainText(), "");
208207
});
209208

210-
testWidgetsOnAndroid(
211-
'when pressing the newline button on the software keyboard at the middle of a paragraph (on Android)',
209+
testWidgetsOnAndroid('when pressing the newline button on the software keyboard at the middle of a paragraph',
212210
(tester) async {
213211
final textContext = await tester //
214212
.createDocument()
@@ -261,7 +259,7 @@ void main() {
261259
expect((textContext.document.getNodeAt(1)! as ParagraphNode).text.toPlainText(), "after link");
262260
});
263261

264-
testWidgetsOnIos('when pressing the newline button on the software keyboard at the end of a paragraph (on iOS)',
262+
testWidgetsOnIos('when pressing the newline button on the software keyboard at the end of a paragraph',
265263
(tester) async {
266264
final textContext = await tester //
267265
.createDocument()
@@ -313,8 +311,7 @@ void main() {
313311
expect((textContext.document.getNodeAt(1)! as ParagraphNode).text.toPlainText(), "");
314312
});
315313

316-
testWidgetsOnIos(
317-
'when pressing the newline button on the software keyboard at the middle of a paragraph (on iOS)',
314+
testWidgetsOnIos('when pressing the newline button on the software keyboard at the middle of a paragraph',
318315
(tester) async {
319316
final textContext = await tester //
320317
.createDocument()
@@ -470,8 +467,7 @@ void main() {
470467
expect((textContext.document.getNodeAt(1)! as ListItemNode).text.toPlainText(), "after link");
471468
});
472469

473-
testWidgetsOnAndroid(
474-
'when pressing the newline button on the software keyboard at the end of a list item (on Android)',
470+
testWidgetsOnAndroid('when pressing the newline button on the software keyboard at the end of a list item',
475471
(tester) async {
476472
final textContext = await tester //
477473
.createDocument()
@@ -524,8 +520,7 @@ void main() {
524520
expect((textContext.document.getNodeAt(1)! as ListItemNode).text.toPlainText(), "");
525521
});
526522

527-
testWidgetsOnAndroid(
528-
'when pressing the newline button on the software keyboard at the middle of a list item (on Android)',
523+
testWidgetsOnAndroid('when pressing the newline button on the software keyboard at the middle of a list item',
529524
(tester) async {
530525
final textContext = await tester //
531526
.createDocument()
@@ -578,7 +573,7 @@ void main() {
578573
expect((textContext.document.getNodeAt(1)! as ListItemNode).text.toPlainText(), "after link");
579574
});
580575

581-
testWidgetsOnIos('when pressing the newline button on the software keyboard at the end of a list item (on iOS)',
576+
testWidgetsOnIos('when pressing the newline button on the software keyboard at the end of a list item',
582577
(tester) async {
583578
final textContext = await tester //
584579
.createDocument()
@@ -632,8 +627,7 @@ void main() {
632627
expect((textContext.document.getNodeAt(1)! as ListItemNode).text.toPlainText(), "");
633628
});
634629

635-
testWidgetsOnIos(
636-
'when pressing the newline button on the software keyboard at the middle of a list item (on iOS)',
630+
testWidgetsOnIos('when pressing the newline button on the software keyboard at the middle of a list item',
637631
(tester) async {
638632
final textContext = await tester //
639633
.createDocument()
@@ -815,8 +809,7 @@ void main() {
815809
expect((document.getNodeAt(1)! as TaskNode).text.toPlainText(), "after link");
816810
});
817811

818-
testWidgetsOnAndroid(
819-
'when pressing the newline button on the software keyboard at the end of a task (on Android)',
812+
testWidgetsOnAndroid('when pressing the newline button on the software keyboard at the end of a task',
820813
(tester) async {
821814
final document = MutableDocument(
822815
nodes: [
@@ -882,8 +875,7 @@ void main() {
882875
expect((document.getNodeAt(1)! as TaskNode).text.toPlainText(), "");
883876
});
884877

885-
testWidgetsOnAndroid(
886-
'when pressing the newline button on the software keyboard at the middle of a task (on Android)',
878+
testWidgetsOnAndroid('when pressing the newline button on the software keyboard at the middle of a task',
887879
(tester) async {
888880
final document = MutableDocument(
889881
nodes: [
@@ -949,7 +941,7 @@ void main() {
949941
expect((document.getNodeAt(1)! as TaskNode).text.toPlainText(), "after link");
950942
});
951943

952-
testWidgetsOnIos('when pressing the newline button on the software keyboard at the end of a task (on iOS)',
944+
testWidgetsOnIos('when pressing the newline button on the software keyboard at the end of a task',
953945
(tester) async {
954946
final document = MutableDocument(
955947
nodes: [
@@ -1016,7 +1008,7 @@ void main() {
10161008
expect((document.getNodeAt(1)! as TaskNode).text.toPlainText(), "");
10171009
});
10181010

1019-
testWidgetsOnIos('when pressing the newline button on the software keyboard at the middle of a task (on iOS)',
1011+
testWidgetsOnIos('when pressing the newline button on the software keyboard at the middle of a task',
10201012
(tester) async {
10211013
final document = MutableDocument(
10221014
nodes: [

super_editor/test/super_textfield/super_textfield_emoji_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ void main() {
445445
);
446446
});
447447

448-
testWidgetsOnAndroid('deletes emojis with BACKSPACE (on Android)', (tester) async {
448+
testWidgetsOnAndroid('deletes emojis with BACKSPACE', (tester) async {
449449
await _pumpSuperTextFieldEmojiTest(
450450
tester,
451451
configuration: SuperTextFieldPlatformConfiguration.android,

super_editor/test/super_textfield/super_textfield_ime_test.dart

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ void main() {
291291
expect(SuperTextFieldInspector.findSelection(), const TextSelection.collapsed(offset: 9));
292292
});
293293

294-
testWidgetsOnMac('when NUMPAD ENTER is pressed in middle of text (on MAC)', (tester) async {
294+
testWidgetsOnMac('when NUMPAD ENTER is pressed in middle of tex', (tester) async {
295295
await _pumpSuperTextField(
296296
tester,
297297
AttributedTextEditingController(
@@ -322,7 +322,7 @@ void main() {
322322
expect(SuperTextFieldInspector.findSelection(), const TextSelection.collapsed(offset: 1));
323323
});
324324

325-
testWidgetsOnMac('when NUMPAD ENTER is pressed at beginning of text (on MAC)', (tester) async {
325+
testWidgetsOnMac('when NUMPAD ENTER is pressed at beginning of text', (tester) async {
326326
await _pumpSuperTextField(
327327
tester,
328328
AttributedTextEditingController(
@@ -353,7 +353,7 @@ void main() {
353353
expect(SuperTextFieldInspector.findSelection(), const TextSelection.collapsed(offset: 18));
354354
});
355355

356-
testWidgetsOnMac('when NUMPAD ENTER is pressed at end of text (on MAC)', (tester) async {
356+
testWidgetsOnMac('when NUMPAD ENTER is pressed at end of text', (tester) async {
357357
await _pumpSuperTextField(
358358
tester,
359359
AttributedTextEditingController(
@@ -812,8 +812,7 @@ void main() {
812812
});
813813

814814
group('SuperTextField on some bad Android software keyboards', () {
815-
testWidgetsOnAndroid('handles BACKSPACE key event instead of deletion for a collapsed selection (on Android)',
816-
(tester) async {
815+
testWidgetsOnAndroid('handles BACKSPACE key event instead of deletion for a collapsed selection', (tester) async {
817816
final controller = AttributedTextEditingController(
818817
text: AttributedText('This is a text'),
819818
);
@@ -835,8 +834,7 @@ void main() {
835834
expect(controller.text.toPlainText(), 'Thi is a text');
836835
});
837836

838-
testWidgetsOnAndroid('handles BACKSPACE key event instead of deletion for a expanded selection (on Android)',
839-
(tester) async {
837+
testWidgetsOnAndroid('handles BACKSPACE key event instead of deletion for a expanded selection', (tester) async {
840838
final controller = AttributedTextEditingController(
841839
text: AttributedText('This is a text'),
842840
);

super_editor/test/super_textfield/super_textfield_theme_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ void main() {
5555
expect(popoverBrightness, Brightness.light);
5656
});
5757

58-
testWidgetsOnAndroid('applies app theme to the popover toolbar (on Android)', (tester) async {
58+
testWidgetsOnAndroid('applies app theme to the popover toolbar', (tester) async {
5959
final controller = ImeAttributedTextEditingController(
6060
controller: AttributedTextEditingController(
6161
text: AttributedText('A single line textfield'),

super_editor/test/test_runners.dart

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ void testWidgetsOnWebDesktop(
3838
bool skip = false,
3939
TestVariant<Object?> variant = const DefaultTestVariant(),
4040
}) {
41-
testWidgetsOnMacWeb("$description (on MAC Web)", test, skip: skip, variant: variant);
42-
testWidgetsOnWindowsWeb("$description (on Windows Web)", test, skip: skip, variant: variant);
43-
testWidgetsOnLinuxWeb("$description (on Linux Web)", test, skip: skip, variant: variant);
41+
testWidgetsOnMacWeb(description, test, skip: skip, variant: variant);
42+
testWidgetsOnWindowsWeb(description, test, skip: skip, variant: variant);
43+
testWidgetsOnLinuxWeb(description, test, skip: skip, variant: variant);
4444
}
4545

4646
/// A widget test that runs a variant for every mobile platform on web, e.g.,
@@ -52,8 +52,8 @@ void testWidgetsOnWebMobile(
5252
bool skip = false,
5353
TestVariant<Object?> variant = const DefaultTestVariant(),
5454
}) {
55-
testWidgetsOnWebIos("$description (on iOS Web)", test, skip: skip, variant: variant);
56-
testWidgetsOnWebAndroid("$description (on Android Web)", test, skip: skip, variant: variant);
55+
testWidgetsOnWebIos(description, test, skip: skip, variant: variant);
56+
testWidgetsOnWebAndroid(description, test, skip: skip, variant: variant);
5757
}
5858

5959
@isTestGroup
@@ -63,8 +63,8 @@ void testWidgetsOnMacDesktopAndWeb(
6363
bool skip = false,
6464
TestVariant<Object?> variant = const DefaultTestVariant(),
6565
}) {
66-
testWidgetsOnMac("$description (on MAC)", test, skip: skip, variant: variant);
67-
testWidgetsOnMacWeb("$description (on MAC Web)", test, skip: skip, variant: variant);
66+
testWidgetsOnMac(description, test, skip: skip, variant: variant);
67+
testWidgetsOnMacWeb(description, test, skip: skip, variant: variant);
6868
}
6969

7070
@isTestGroup
@@ -74,7 +74,7 @@ void testWidgetsOnMacWeb(
7474
bool skip = false,
7575
TestVariant<Object?> variant = const DefaultTestVariant(),
7676
}) {
77-
testWidgets(description, (tester) async {
77+
testWidgets("$description (on MAC Web)", (tester) async {
7878
debugDefaultTargetPlatformOverride = TargetPlatform.macOS;
7979
debugIsWebOverride = WebPlatformOverride.web;
8080

@@ -121,7 +121,7 @@ void testWidgetsOnWebIos(
121121
bool skip = false,
122122
TestVariant<Object?> variant = const DefaultTestVariant(),
123123
}) {
124-
testWidgets(description, (tester) async {
124+
testWidgets("$description (on iOS Web)", (tester) async {
125125
debugDefaultTargetPlatformOverride = TargetPlatform.iOS;
126126
debugIsWebOverride = WebPlatformOverride.web;
127127

@@ -152,7 +152,7 @@ void testWidgetsOnWebAndroid(
152152
bool skip = false,
153153
TestVariant<Object?> variant = const DefaultTestVariant(),
154154
}) {
155-
testWidgets(description, (tester) async {
155+
testWidgets("$description (on Android Web)", (tester) async {
156156
debugDefaultTargetPlatformOverride = TargetPlatform.android;
157157
debugIsWebOverride = WebPlatformOverride.web;
158158

@@ -172,7 +172,7 @@ void testWidgetsOnWindowsWeb(
172172
bool skip = false,
173173
TestVariant<Object?> variant = const DefaultTestVariant(),
174174
}) {
175-
testWidgets(description, (tester) async {
175+
testWidgets("$description (on Windows Web)", (tester) async {
176176
debugDefaultTargetPlatformOverride = TargetPlatform.windows;
177177
debugIsWebOverride = WebPlatformOverride.web;
178178

@@ -196,7 +196,7 @@ void testWidgetsOnLinuxWeb(
196196
bool skip = false,
197197
TestVariant<Object?> variant = const DefaultTestVariant(),
198198
}) {
199-
testWidgets(description, (tester) async {
199+
testWidgets("$description (on Linux Web)", (tester) async {
200200
debugDefaultTargetPlatformOverride = TargetPlatform.linux;
201201
debugIsWebOverride = WebPlatformOverride.web;
202202

0 commit comments

Comments
 (0)