Skip to content

Commit 0615e3c

Browse files
authored
[material_ui] Enable date_range_picker_test (#12010)
Port over `date_range_picker_test` from flutter/flutter#184279 Work towards flutter/flutter#182636 and flutter/flutter#188395 ## 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 c9171a7 commit 0615e3c

1 file changed

Lines changed: 45 additions & 35 deletions

File tree

packages/material_ui/temporarily_disabled_tests/date_range_picker_test.dart renamed to packages/material_ui/test/date_range_picker_test.dart

Lines changed: 45 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
@Skip(
6-
'This file is skipped due to a cross-import that needs to be fixed. Tracked in https://github.com/flutter/flutter/issues/177028.',
7-
)
5+
import 'dart:async';
86
import 'dart:ui';
97

10-
import 'package:material_ui/material_ui.dart';
118
import 'package:flutter/services.dart';
129
import 'package:flutter_test/flutter_test.dart';
10+
import 'package:material_ui/material_ui.dart';
1311

14-
import '../widgets/feedback_tester.dart';
12+
import 'feedback_tester.dart';
1513

1614
void main() {
1715
late DateTime firstDate;
@@ -1210,12 +1208,14 @@ void main() {
12101208
await tester.tap(find.text('Go'));
12111209
expect(buttonContext, isNotNull);
12121210

1213-
showDateRangePicker(
1214-
context: buttonContext,
1215-
initialDateRange: initialDateRange,
1216-
firstDate: firstDate,
1217-
lastDate: lastDate,
1218-
initialEntryMode: DatePickerEntryMode.input,
1211+
unawaited(
1212+
showDateRangePicker(
1213+
context: buttonContext,
1214+
initialDateRange: initialDateRange,
1215+
firstDate: firstDate,
1216+
lastDate: lastDate,
1217+
initialEntryMode: DatePickerEntryMode.input,
1218+
),
12191219
);
12201220
await tester.pumpAndSettle();
12211221

@@ -1406,11 +1406,13 @@ void main() {
14061406
);
14071407

14081408
final BuildContext context = tester.element(find.text('Test'));
1409-
showDateRangePicker(
1410-
context: context,
1411-
firstDate: DateTime(2018),
1412-
lastDate: DateTime(2030),
1413-
anchorPoint: const Offset(1000, 0),
1409+
unawaited(
1410+
showDateRangePicker(
1411+
context: context,
1412+
firstDate: DateTime(2018),
1413+
lastDate: DateTime(2030),
1414+
anchorPoint: const Offset(1000, 0),
1415+
),
14141416
);
14151417
await tester.pumpAndSettle();
14161418

@@ -1443,11 +1445,13 @@ void main() {
14431445
);
14441446

14451447
final BuildContext context = tester.element(find.text('Test'));
1446-
showDateRangePicker(
1447-
context: context,
1448-
firstDate: DateTime(2018),
1449-
lastDate: DateTime(2030),
1450-
anchorPoint: const Offset(1000, 0),
1448+
unawaited(
1449+
showDateRangePicker(
1450+
context: context,
1451+
firstDate: DateTime(2018),
1452+
lastDate: DateTime(2030),
1453+
anchorPoint: const Offset(1000, 0),
1454+
),
14511455
);
14521456
await tester.pumpAndSettle();
14531457

@@ -1480,7 +1484,9 @@ void main() {
14801484
);
14811485

14821486
final BuildContext context = tester.element(find.text('Test'));
1483-
showDateRangePicker(context: context, firstDate: DateTime(2018), lastDate: DateTime(2030));
1487+
unawaited(
1488+
showDateRangePicker(context: context, firstDate: DateTime(2018), lastDate: DateTime(2030)),
1489+
);
14841490
await tester.pumpAndSettle();
14851491

14861492
// By default it should place the dialog on the left screen
@@ -1536,22 +1542,26 @@ void main() {
15361542

15371543
if (keyboardType == null) {
15381544
// If no keyboardType, expect the default.
1539-
showDateRangePicker(
1540-
context: buttonContext,
1541-
initialDateRange: initialDateRange,
1542-
firstDate: firstDate,
1543-
lastDate: lastDate,
1544-
initialEntryMode: DatePickerEntryMode.input,
1545+
unawaited(
1546+
showDateRangePicker(
1547+
context: buttonContext,
1548+
initialDateRange: initialDateRange,
1549+
firstDate: firstDate,
1550+
lastDate: lastDate,
1551+
initialEntryMode: DatePickerEntryMode.input,
1552+
),
15451553
);
15461554
} else {
15471555
// If there is a keyboardType, expect it to be passed through.
1548-
showDateRangePicker(
1549-
context: buttonContext,
1550-
initialDateRange: initialDateRange,
1551-
firstDate: firstDate,
1552-
lastDate: lastDate,
1553-
initialEntryMode: DatePickerEntryMode.input,
1554-
keyboardType: keyboardType,
1556+
unawaited(
1557+
showDateRangePicker(
1558+
context: buttonContext,
1559+
initialDateRange: initialDateRange,
1560+
firstDate: firstDate,
1561+
lastDate: lastDate,
1562+
initialEntryMode: DatePickerEntryMode.input,
1563+
keyboardType: keyboardType,
1564+
),
15551565
);
15561566
}
15571567
await tester.pumpAndSettle();

0 commit comments

Comments
 (0)