[Part 2][TF-4479] Add integration tests for clear trash subfolders#4577
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This PR has been deployed to https://linagora.github.io/tmail-flutter/4577. |
75716c3 to
06d87d2
Compare
f28fbe6 to
3d2b65d
Compare
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@integration_test/mixin/scenario_utils_mixin.dart`:
- Around line 308-310: The current guard uses "isMissingRequiredData" (session,
accountId, trashMailboxId) and returns silently, which can allow false-positive
tests; replace the early return with a failing setup exception (e.g., throw a
StateError or test failure) that includes which of
session/accountId/trashMailboxId is missing and a clear message referencing the
clear-trash provisioning step so test harnesses immediately fail rather than
continuing without the trash subfolder.
In `@integration_test/robots/web/web_thread_robot.dart`:
- Around line 54-63: The fireOnTap helper is brittle because it force-casts
span.recognizer to TapGestureRecognizer and silently does nothing when no
tappable span matches; update fireOnTap (and the analogous method around lines
67–72) to: iterate only over TextSpan children, check that span.text == text,
then check recognizer is non-null and is a TapGestureRecognizer (using an
is-type check) before calling onTap; if the recognizer is not the expected type
or no matching tappable span is found, surface a clear failure (throw a
descriptive exception or assert) so tests fail fast and the runtime cast cannot
throw unexpectedly.
In
`@integration_test/scenarios/mailbox/clear_trash_subfolders_via_banner_scenario.dart`:
- Around line 20-30: After provisioning the trash subfolder with
provisionTrashSubfolder(_subfolderName) and navigating to the Trash, add a
pre-action assertion that the subfolder exists (the counterpart to
expectSubfolderNotExist) before performing the delete flow; locate the
setup/navigation around provisionTrashSubfolder, threadRobot.openMailbox,
mailboxMenuRobot.openFolderByName and threadRobot.expectTrashBannerVisible and
insert a call to the existing positive assertion (e.g., expectSubfolderExist or
expectSubfolderVisible that mirrors expectSubfolderNotExist) using
_subfolderName, then continue with the delete and final expectSubfolderNotExist
assertion.
In
`@integration_test/scenarios/mailbox/clear_trash_subfolders_via_context_menu_scenario.dart`:
- Around line 20-30: Add an explicit precondition assertion that the provisioned
trash subfolder exists before invoking the context-menu "empty trash" flow:
after calling provisionTrashSubfolder(_subfolderName) and before triggering the
context menu actions (e.g., before
threadRobot.openMailbox()/mailboxMenuRobot.openFolderByName and before the
corresponding section at lines 39-41), call the existing assertion helper (e.g.,
expectSubfolderExists or a mailboxRobot method that checks folder presence) to
verify _subfolderName is present; this ensures the test fails if setup didn't
create the subfolder rather than silently passing and only relying on the later
expectSubfolderNotExist check.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 76db336a-894d-4997-8857-590a741399cc
📒 Files selected for processing (14)
integration_test/mixin/scenario_utils_mixin.dartintegration_test/robots/abstract/abstract_mailbox_menu_robot.dartintegration_test/robots/abstract/abstract_thread_robot.dartintegration_test/robots/mailbox_menu_robot.dartintegration_test/robots/mobile/mobile_thread_robot.dartintegration_test/robots/thread_robot.dartintegration_test/robots/web/web_mailbox_menu_robot.dartintegration_test/robots/web/web_thread_robot.dartintegration_test/scenarios/mailbox/clear_trash_subfolders_via_banner_scenario.dartintegration_test/scenarios/mailbox/clear_trash_subfolders_via_context_menu_scenario.dartintegration_test/tests/mailbox/clear_trash_subfolders_via_banner_test.dartintegration_test/tests/mailbox/clear_trash_subfolders_via_context_menu_test.dartlib/features/base/model/ui_keys.dartlib/features/mailbox/presentation/widgets/label_mailbox_item_widget.dart
034ee22 to
cf6f0a6
Compare
Signed-off-by: dab246 <tdvu@linagora.com>
Signed-off-by: dab246 <tdvu@linagora.com>
c9c2e4e to
a0a4d00
Compare
…r placeholder Web dashboard rendered SizedBox.shrink() without the key when no banner is shown, causing WebThreadRobot.expectTrashBannerInvisible() to hang on waitUntilExists().
There was a problem hiding this comment.
Our agent can fix these. Install it.
Gates Passed
3 Quality Gates Passed
Quality Gate Profile: The Bare Minimum
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.
Summary
MailboxMenuRobot,ThreadRobot, web variants) with clear-trash actionsResult
Summary by CodeRabbit