From a17d6b7eec6bae4faa981589c868529d24c804d8 Mon Sep 17 00:00:00 2001 From: Richard Shiue <71320345+richardshiue@users.noreply.github.com> Date: Wed, 28 Jun 2023 22:11:50 +0800 Subject: [PATCH] test: fix integration test (#2906) * test: fix calendar integration test * test: add comment for workaround --- .../integration_test/util/database_test_op.dart | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/frontend/appflowy_flutter/integration_test/util/database_test_op.dart b/frontend/appflowy_flutter/integration_test/util/database_test_op.dart index 61b6d98146..a9035a8f90 100644 --- a/frontend/appflowy_flutter/integration_test/util/database_test_op.dart +++ b/frontend/appflowy_flutter/integration_test/util/database_test_op.dart @@ -294,7 +294,17 @@ extension AppFlowyDatabaseTest on WidgetTester { matching: findDay, ); - await tapButton(finder); + // if the day is very near the beginning or the end of the month, + // it may overlap with the same day in the next or previous month, + // respectively because it was spilling over. This will lead to 2 + // widgets being found and thus cannot be tapped correctly. + if (content < 15) { + // e.g., Jan 2 instead of Feb 2 + await tapButton(finder.first); + } else { + // e.g. Jun 28 instead of May 28 + await tapButton(finder.last); + } } Future toggleIncludeTime() async {