Skip to content

Commit

Permalink
Remove test suffixes
Browse files Browse the repository at this point in the history
  • Loading branch information
angelosilvestre committed Nov 26, 2023
1 parent f433964 commit 897a717
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -550,8 +550,7 @@ Second paragraph"""). //
);
});

testWidgetsOnIos(
'when the user presses the newline button on the software keyboard at the end of an image (on iOS)',
testWidgetsOnIos('when the user presses the newline button on the software keyboard at the end of an image',
(tester) async {
final testContext = await tester
.createDocument()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ spans multiple lines.''',
expect(find.byType(AndroidSelectionHandle), findsOneWidget);
});

testWidgetsOnIos('configures default gesture mode (on iOS)', (tester) async {
testWidgetsOnIos('configures default gesture mode', (tester) async {
await tester //
.createDocument()
.withSingleParagraph()
Expand Down
105 changes: 51 additions & 54 deletions super_editor/test/super_textfield/super_textfield_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -97,76 +97,73 @@ void main() {
});

group("on mobile", () {
group("configures inner textfield textInputAction for newline when it's multiline", () {
testWidgetsOnAndroid('(on Android)', (tester) async {
await tester.pumpWidget(
_buildScaffold(
child: const SuperTextField(
minLines: 10,
maxLines: 10,
),
testWidgetsOnAndroid("configures inner textfield textInputAction for newline when it's multiline",
(tester) async {
await tester.pumpWidget(
_buildScaffold(
child: const SuperTextField(
minLines: 10,
maxLines: 10,
),
);
),
);

final innerTextField = tester.widget<SuperAndroidTextField>(find.byType(SuperAndroidTextField).first);
final innerTextField = tester.widget<SuperAndroidTextField>(find.byType(SuperAndroidTextField).first);

// Ensure inner textfield action is configured to newline
// so we are able to receive new lines
expect(innerTextField.textInputAction, TextInputAction.newline);
});
// Ensure inner textfield action is configured to newline
// so we are able to receive new lines
expect(innerTextField.textInputAction, TextInputAction.newline);
});

testWidgetsOnIos('(on iOS)', (tester) async {
await tester.pumpWidget(
_buildScaffold(
child: const SuperTextField(
minLines: 10,
maxLines: 10,
),
testWidgetsOnIos("configures inner textfield textInputAction for newline when it's multiline", (tester) async {
await tester.pumpWidget(
_buildScaffold(
child: const SuperTextField(
minLines: 10,
maxLines: 10,
),
);
),
);

final innerTextField = tester.widget<SuperIOSTextField>(find.byType(SuperIOSTextField).first);
final innerTextField = tester.widget<SuperIOSTextField>(find.byType(SuperIOSTextField).first);

// Ensure inner textfield action is configured to newline
// so we are able to receive new lines
expect(innerTextField.textInputAction, TextInputAction.newline);
});
// Ensure inner textfield action is configured to newline
// so we are able to receive new lines
expect(innerTextField.textInputAction, TextInputAction.newline);
});

group("configures inner textfield textInputAction for done when it's singleline", () {
testWidgetsOnAndroid('(on Android)', (tester) async {
await tester.pumpWidget(
_buildScaffold(
child: const SuperTextField(
minLines: 1,
maxLines: 1,
),
testWidgetsOnAndroid("configures inner textfield textInputAction for done when it's singleline", (tester) async {
await tester.pumpWidget(
_buildScaffold(
child: const SuperTextField(
minLines: 1,
maxLines: 1,
),
);
),
);

final innerTextField = tester.widget<SuperAndroidTextField>(find.byType(SuperAndroidTextField).first);
final innerTextField = tester.widget<SuperAndroidTextField>(find.byType(SuperAndroidTextField).first);

// Ensure inner textfield action is configured to done
// because we should NOT receive new lines
expect(innerTextField.textInputAction, TextInputAction.done);
});
// Ensure inner textfield action is configured to done
// because we should NOT receive new lines
expect(innerTextField.textInputAction, TextInputAction.done);
});

testWidgetsOnIos('(on iOS)', (tester) async {
await tester.pumpWidget(
_buildScaffold(
child: const SuperTextField(
minLines: 1,
maxLines: 1,
),
testWidgetsOnIos("configures inner textfield textInputAction for done when it's singleline", (tester) async {
await tester.pumpWidget(
_buildScaffold(
child: const SuperTextField(
minLines: 1,
maxLines: 1,
),
);
),
);

final innerTextField = tester.widget<SuperIOSTextField>(find.byType(SuperIOSTextField).first);
final innerTextField = tester.widget<SuperIOSTextField>(find.byType(SuperIOSTextField).first);

// Ensure inner textfield action is configured to done
// because we should NOT receive new lines
expect(innerTextField.textInputAction, TextInputAction.done);
});
// Ensure inner textfield action is configured to done
// because we should NOT receive new lines
expect(innerTextField.textInputAction, TextInputAction.done);
});

testWidgetsOnIos('applies keyboard appearance', (tester) async {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import 'super_textfield_robot.dart';

void main() {
group('SuperTextField', () {
testWidgetsOnIos('applies app theme to the popover toolbar (on iOS)', (tester) async {
testWidgetsOnIos('applies app theme to the popover toolbar', (tester) async {
final controller = ImeAttributedTextEditingController(
controller: AttributedTextEditingController(
text: AttributedText('A single line textfield'),
Expand Down

0 comments on commit 897a717

Please sign in to comment.