Skip to content

Commit f9624a5

Browse files
[cupertino_ui] Unskip web tests that pass on CanvasKit and Skwasm: date_picker_test, spell_check_suggestions_toolbar_test (flutter#13367)
Removes web skips from two `cupertino_ui` tests that now pass on the web under both CanvasKit (dart2js) and Skwasm (dart2wasm), so web regressions in these tests are no longer hidden: - `date_picker_test.dart`: the `getColumnWidth` unicode spaces calculation test was skipped with `isBrowser` (flutter#39998); it now passes on web. - `spell_check_suggestions_toolbar_test.dart`: the "more than three suggestions throws an error" test was skipped with `kIsWeb`; the assertion is thrown correctly on web. The now-unused `package:flutter/foundation.dart` import is removed. Verified locally with `flutter test --platform chrome` and `flutter test --platform chrome --wasm` for both files (all tests pass). Neither unskipped test uses golden files. Related: flutter#39998 This is a test-only change, so no version bump or CHANGELOG entry is needed. ## Pre-Review Checklist **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
1 parent 2ef3d18 commit f9624a5

2 files changed

Lines changed: 19 additions & 24 deletions

File tree

‎packages/cupertino_ui/test/date_picker_test.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2548,7 +2548,7 @@ void main() {
25482548

25492549
expect(testWidth, equals(largestWidth));
25502550
expect(widths.indexOf(largestWidth), equals(1));
2551-
}, skip: isBrowser); // https://github.com/flutter/flutter/issues/39998
2551+
});
25522552

25532553
test('showTimeSeparator is only supported in time or dateAndTime mode', () async {
25542554
expect(

‎packages/cupertino_ui/test/spell_check_suggestions_toolbar_test.dart‎

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,34 @@
33
// found in the LICENSE file.
44

55
import 'package:cupertino_ui/cupertino_ui.dart';
6-
import 'package:flutter/foundation.dart';
76
import 'package:flutter/services.dart';
87

98
import 'package:flutter_test/flutter_test.dart';
109

1110
void main() {
1211
TestWidgetsFlutterBinding.ensureInitialized();
1312

14-
testWidgets(
15-
'more than three suggestions throws an error',
16-
(WidgetTester tester) async {
17-
Future<void> pumpToolbar(List<String> suggestions) async {
18-
await tester.pumpWidget(
19-
CupertinoApp(
20-
home: Center(
21-
child: CupertinoSpellCheckSuggestionsToolbar(
22-
anchors: const TextSelectionToolbarAnchors(primaryAnchor: Offset.zero),
23-
buttonItems: suggestions.map((String string) {
24-
return ContextMenuButtonItem(onPressed: () {}, label: string);
25-
}).toList(),
26-
),
13+
testWidgets('more than three suggestions throws an error', (WidgetTester tester) async {
14+
Future<void> pumpToolbar(List<String> suggestions) async {
15+
await tester.pumpWidget(
16+
CupertinoApp(
17+
home: Center(
18+
child: CupertinoSpellCheckSuggestionsToolbar(
19+
anchors: const TextSelectionToolbarAnchors(primaryAnchor: Offset.zero),
20+
buttonItems: suggestions.map((String string) {
21+
return ContextMenuButtonItem(onPressed: () {}, label: string);
22+
}).toList(),
2723
),
2824
),
29-
);
30-
}
25+
),
26+
);
27+
}
3128

32-
await pumpToolbar(<String>['hello', 'yellow', 'yell']);
33-
expect(() async {
34-
await pumpToolbar(<String>['hello', 'yellow', 'yell', 'yeller']);
35-
}, throwsAssertionError);
36-
},
37-
skip: kIsWeb, // [intended]
38-
);
29+
await pumpToolbar(<String>['hello', 'yellow', 'yell']);
30+
expect(() async {
31+
await pumpToolbar(<String>['hello', 'yellow', 'yell', 'yeller']);
32+
}, throwsAssertionError);
33+
});
3934

4035
test('buildSuggestionButtons only considers the first three suggestions', () {
4136
final editableTextState = _FakeEditableTextState(

0 commit comments

Comments
 (0)