feat(client): 列表日期列改名入库/出库时间删审核时间列 + 日期控件改可键入框带日历
Deploy Client / build-client-web (push) Successful in 41s
Deploy Client / build-windows (push) Successful in 2m34s
Deploy Client / build-macos (push) Successful in 2m20s
Deploy Client / build-android (push) Successful in 1m5s
Deploy Client / build-ios (push) Successful in 2m44s
Deploy Client / release-deploy-client (push) Successful in 1m26s
Deploy Client / build-client-web (push) Successful in 41s
Deploy Client / build-windows (push) Successful in 2m34s
Deploy Client / build-macos (push) Successful in 2m20s
Deploy Client / build-android (push) Successful in 1m5s
Deploy Client / build-ios (push) Successful in 2m44s
Deploy Client / release-deploy-client (push) Successful in 1m26s
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YZ4DskSRKsSiheQonFtQvx
This commit is contained in:
@@ -31,26 +31,47 @@ void main() {
|
||||
});
|
||||
|
||||
group('DatePickerField', () {
|
||||
testWidgets('渲染三个年/月/日下拉框', (tester) async {
|
||||
testWidgets('渲染可键入框 + 日历图标', (tester) async {
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
home: Scaffold(
|
||||
body: DatePickerField(value: '2026-06-19', onChanged: (_) {}),
|
||||
),
|
||||
));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byType(DropdownMenu<int>), findsNWidgets(3));
|
||||
expect(find.byType(TextField), findsOneWidget);
|
||||
expect(find.byIcon(Icons.calendar_today), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('初始值回显到三个下拉框', (tester) async {
|
||||
testWidgets('初始值回显到输入框', (tester) async {
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
home: Scaffold(
|
||||
body: DatePickerField(value: '2026-06-19', onChanged: (_) {}),
|
||||
),
|
||||
));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.widgetWithText(DropdownMenu<int>, '2026'), findsOneWidget);
|
||||
expect(find.widgetWithText(DropdownMenu<int>, '6'), findsOneWidget);
|
||||
expect(find.widgetWithText(DropdownMenu<int>, '19'), findsOneWidget);
|
||||
expect(find.text('2026-06-19'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('只输年份归一为 yyyy-01-01', (tester) async {
|
||||
String? out;
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
home: Scaffold(
|
||||
body: DatePickerField(onChanged: (v) => out = v),
|
||||
),
|
||||
));
|
||||
await tester.enterText(find.byType(TextField), '2024');
|
||||
expect(out, '2024-01-01');
|
||||
});
|
||||
|
||||
testWidgets('年月归一为 yyyy-MM-01', (tester) async {
|
||||
String? out;
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
home: Scaffold(
|
||||
body: DatePickerField(onChanged: (v) => out = v),
|
||||
),
|
||||
));
|
||||
await tester.enterText(find.byType(TextField), '2024-5');
|
||||
expect(out, '2024-05-01');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user