PR 9: E2E — File Actions & Error States#438
Conversation
- file-actions.spec.ts: 11 tests covering file row selection, action button visibility, disabled states, delete confirmation double-click pattern, selection switching, and bulk action bar presence - error-states.spec.ts: 5 tests covering no-enabled-pairs warning notification, notification text/level, restart notification on config change, and re-enabling a pair clears the warning Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughTwo new Playwright e2e test files are added to validate UI behavior: one tests error state alerts for disabled path pairs and server address changes, the other validates file action buttons and bulk action interactions in the dashboard interface. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsTimed out fetching pipeline failures after 30000ms 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 |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/e2e-playwright/tests/error-states.spec.ts`:
- Around line 141-144: The locator for the restart notification is too broad and
may match unrelated alerts; update the locator creation (the variable named
notification) to scope to the header alerts by changing the selector from
".alert" to "#header .alert" (i.e., const notification = page.locator("#header
.alert", { hasText: /restart/i });) so the expect(notification).toBeVisible(...)
only checks header-specific alerts.
- Around line 10-23: The arrange/teardown currently swallows API failures by
treating a failed GET as an empty list and not checking PUT results; update the
setup/cleanup around apiFetch calls to fail fast: after calling
apiFetch("/server/pathpairs") check/assert that res.ok is true before using
res.json() and throw or fail the test if not, and likewise assert each PUT
response (the response returned from apiFetch(`/server/pathpairs/${pair.id}`, {
method: "PUT", ... })) has .ok true and handle/throw on failure; keep using
originalStates to track prior enabled flags but ensure all apiFetch calls are
asserted so backend setup/teardown failures are surfaced immediately.
- Around line 70-118: The temporary pair cleanup (tempPairId) is done inside the
try block and can be skipped on early failures; move the deletion into the
finally block so it always runs: keep tempPairId declared where it is, remove
the in-try deletion, and in the finally block (after restoring originalStates)
check if tempPairId is set and call apiFetch(`/server/pathpairs/${tempPairId}`,
{ method: "DELETE" }) with await so the temp pair is always removed; reference
tempPairId, apiFetch, and the existing finally loop restoring originalStates
when making this change.
In `@src/e2e-playwright/tests/file-actions.spec.ts`:
- Around line 105-110: After deselecting the row (the existing await row.click()
and await expect(row).not.toHaveClass(/selected/) block), add a direct assertion
that the actions container element inside that row is hidden; locate it from the
same row variable (e.g., const actions = row.locator('.actions') or
row.locator('.file-actions')) and assert await expect(actions).not.toBeVisible()
(or the equivalent hidden-class assertion) so the test verifies UI visibility in
addition to the removed "selected" class.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 38fb15c5-c066-492f-90b6-991ff432811c
📒 Files selected for processing (2)
src/e2e-playwright/tests/error-states.spec.tssrc/e2e-playwright/tests/file-actions.spec.ts
- error-states: Extract disableAllPairs/restorePairs helpers that always ensure a disabled pair exists (fixes all 4 failures -- the backend only sets noEnabledPairs when pairs exist but none are enabled) - error-states: Assert res.ok on every API setup/teardown call - error-states: Move temp pair cleanup into finally via restorePairs helper - error-states: Scope restart notification locator to #header .alert - settings: Remove separate clear() before fill() to avoid Angular signal re-render race; add blur() and toBeEnabled wait; increase poll timeout - settings.page: Scope getRestartNotification() to #header .alert - file-actions: Assert .actions container is hidden after deselection Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The noEnabledPairs notification requires status.server.up === true, which only happens when the server has valid config (remote address, paths, etc.). CI containers start with incomplete config so the controller never evaluates pair state. Skip these tests when the server reports as not up, matching the existing skip pattern used in dashboard.spec.ts for file-dependent tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
file-actions.spec.tswith 11 tests covering file row selection, action button visibility/disabled states, delete confirmation double-click pattern, selection switching, and bulk action bar operationserror-states.spec.tswith 5 tests covering no-enabled-pairs warning notification, notification text and alert level, restart notification on config change, and re-enabling a pair clears the warningTest plan
file-actions.spec.tstests properly skip when no files present on remote seedboxerror-states.spec.tstests restore original pair enabled states infinallyblocks🤖 Generated with Claude Code
Summary by CodeRabbit