Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

fix: date reminder test (#6681)

Lucaseff37d74dc9c
diff --git a/frontend/appflowy_flutter/integration_test/desktop/document/document_with_date_reminder_test.dart b/frontend/appflowy_flutter/integration_test/desktop/document/document_with_date_reminder_test.dart
index e8c980d6f0..7d4275da36 100644
--- a/frontend/appflowy_flutter/integration_test/desktop/document/document_with_date_reminder_test.dart
+++ b/frontend/appflowy_flutter/integration_test/desktop/document/document_with_date_reminder_test.dart
@@ -2,6 +2,7 @@ import 'package:appflowy/generated/flowy_svgs.g.dart';
import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/plugins/document/presentation/editor_plugins/mention/mention_date_block.dart';
import 'package:appflowy/workspace/application/settings/date_time/date_format_ext.dart';
+import 'package:appflowy/workspace/presentation/widgets/date_picker/appflowy_date_picker.dart';
import 'package:appflowy/workspace/presentation/widgets/toggle/toggle.dart';
import 'package:appflowy_backend/protobuf/flowy-user/protobuf.dart';
import 'package:easy_localization/easy_localization.dart';
@@ -50,17 +51,18 @@ void main() {
await tester.tap(find.byType(MentionDateBlock));
await tester.pumpAndSettle();
- final currentTime = DateFormat('HH:mm').format(DateTime.now());
-
// tap the toggle of include time
await tester.tap(find.byType(Toggle));
await tester.pumpAndSettle();
// add time 11:12
- final textField = find.byWidgetPredicate(
- (widget) =>
- widget is TextField && widget.controller!.text == currentTime,
- );
+ final textField = find
+ .descendant(
+ of: find.byType(AppFlowyDatePicker),
+ matching: find.byType(TextField),
+ )
+ .last;
+ await tester.pumpUntilFound(textField);
await tester.enterText(textField, "11:12");
await tester.testTextInput.receiveAction(TextInputAction.done);
await tester.pumpAndSettle();