@@ -26,15 +26,16 @@ void main() {
26
26
testWidgetsOnIos ("shows toolbar when tapping on caret" , (tester) async {
27
27
await _pumpSingleParagraphApp (tester);
28
28
29
- // Place the caret.
30
- await tester.tapInParagraph ("1" , 200 );
29
+ // Place the caret at the end of a word, because iOS snaps the caret
30
+ // to word boundaries by default.
31
+ await tester.tapInParagraph ("1" , 207 );
31
32
32
33
// Ensure all controls are hidden.
33
34
expect (SuperEditorInspector .isMobileMagnifierVisible (), isFalse);
34
35
expect (SuperEditorInspector .isMobileToolbarVisible (), isFalse);
35
36
36
37
// Tap again on the caret.
37
- await tester.tapInParagraph ("1" , 200 );
38
+ await tester.tapInParagraph ("1" , 207 );
38
39
39
40
// Ensure that the toolbar is visible.
40
41
expect (SuperEditorInspector .isMobileToolbarVisible (), isTrue);
@@ -218,7 +219,7 @@ void main() {
218
219
});
219
220
220
221
testWidgetsOnIos ("keeps current selection when tapping on caret" , (tester) async {
221
- await _pumpSingleParagraphApp (tester, useIosSelectionHeuristics : true );
222
+ await _pumpSingleParagraphApp (tester);
222
223
223
224
// Tap at "consectetur|" to place the caret.
224
225
await tester.tapInParagraph ("1" , 39 );
@@ -373,15 +374,12 @@ void main() {
373
374
});
374
375
}
375
376
376
- Future <void > _pumpSingleParagraphApp (
377
- WidgetTester tester, {
378
- bool useIosSelectionHeuristics = false ,
379
- }) async {
377
+ Future <void > _pumpSingleParagraphApp (WidgetTester tester) async {
380
378
await tester
381
379
.createDocument ()
382
380
// Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor...
383
381
.withSingleParagraph ()
384
382
.simulateSoftwareKeyboardInsets (true )
385
- .useIosSelectionHeuristics (useIosSelectionHeuristics )
383
+ .useIosSelectionHeuristics (true )
386
384
.pump ();
387
385
}
0 commit comments