Skip to content

test: add E2E tests for file versioning#164

Merged
FSM1 merged 8 commits into
mainfrom
feat/quick-018-e2e-versioning
Feb 19, 2026
Merged

test: add E2E tests for file versioning#164
FSM1 merged 8 commits into
mainfrom
feat/quick-018-e2e-versioning

Conversation

@FSM1

@FSM1 FSM1 commented Feb 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • Extend DetailsDialogPage with 12 version history interaction methods (section visibility, version count, download/restore/delete clicks, inline confirm/cancel)
  • Add 3 serial E2E tests (6.6.1–6.6.3) to full-workflow.spec.ts covering version history display, version restore, and version delete
  • Tests build on existing text editor fixture — first version created automatically by test 6.5.3's save

Test plan

  • Run pnpm --filter e2e test with API and web dev servers running
  • Verify tests 6.6.1–6.6.3 pass against a live environment with versioning enabled
  • Verify existing tests (6.5.x, 7.x) are unaffected by new test insertion

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Added end-to-end tests for file versioning covering version history visibility, version restoration, and version deletion operations.
    • Enhanced test infrastructure with comprehensive version history interaction methods for the Details dialog.

FSM1 and others added 5 commits February 19, 2026 20:37
Extends full-workflow E2E suite with version history tests:
- Extend DetailsDialogPage page object with version history methods
- Add 3 test cases: version display, restore, delete

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add version section, entry, and action button locators
- Add inline confirm dialog locators (yes/no buttons)
- Add version error locator
- Add interaction methods: getVersionCount, clickVersionRestore,
  clickVersionDelete, confirmVersionAction, cancelVersionAction,
  waitForVersionSection, getVersionNumberText, getVersionSizeText

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Test 6.6.1: Version history visible in Details dialog after text
  editor save, verifies version count and version numbering
- Test 6.6.2: Restore a past version via inline confirm, verifies
  content reverts to pre-edit state via text editor
- Test 6.6.3: Delete a past version via inline confirm, verifies
  version section disappears when no versions remain

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tasks completed: 2/2
- Extend DetailsDialogPage with version history methods
- Add versioning test cases to full-workflow.spec.ts

SUMMARY: .planning/quick/018-e2e-versioning-tests/018-SUMMARY.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Quick task completed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Feb 19, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@FSM1 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 15 minutes and 29 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Walkthrough

This PR adds comprehensive E2E test coverage for file versioning functionality. It extends the DetailsDialogPage with version history interaction methods (locators and helper functions) and introduces three test cases covering version visibility, restoration, and deletion scenarios within the full-workflow test suite.

Changes

Cohort / File(s) Summary
Planning Documentation
.planning/STATE.md, .planning/quick/018-e2e-versioning-tests/018-PLAN.md, .planning/quick/018-e2e-versioning-tests/018-SUMMARY.md
Updated planning state and added planning documentation for E2E versioning tests quick task, including task specifications for page object extension and test case addition.
Page Object Extension
tests/e2e/page-objects/dialogs/details-dialog.page.ts
Added 24 new methods to DetailsDialogPage for version history interaction, including locators for section/entries/actions, helper methods for visibility/counting/text retrieval, and interaction methods for download/restore/delete actions with inline confirmation dialog support.
E2E Test Cases
tests/e2e/tests/full-workflow.spec.ts
Added three new test cases for Phase 6.6 (File Versioning) verifying version history visibility (v1 version present), successful version restoration with content verification, and version deletion with section visibility updates.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'test: add E2E tests for file versioning' clearly and concisely summarizes the main change—adding end-to-end tests for file versioning functionality. It directly corresponds to the primary focus of the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/quick-018-e2e-versioning

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
tests/e2e/page-objects/dialogs/details-dialog.page.ts (1)

259-275: Prefer anchored regex over plain strings in hasText to avoid unintended substring matches.

Playwright treats a plain hasText string as a case-insensitive substring check, so { hasText: 'rm' } matches any button whose text contains "rm" (e.g., "confirm", "form"). Since the buttons are scoped within .details-version-entry this is low-risk today, but anchored regex makes the intent explicit and guards against future button additions.

♻️ Proposed fix using anchored regex
  versionDownloadBtn(index: number): Locator {
-   return this.versionEntry(index).locator('button', { hasText: 'dl' });
+   return this.versionEntry(index).locator('button', { hasText: /^dl$/i });
  }

  versionRestoreBtn(index: number): Locator {
-   return this.versionEntry(index).locator('button', { hasText: 'restore' });
+   return this.versionEntry(index).locator('button', { hasText: /^restore$/i });
  }

  versionDeleteBtn(index: number): Locator {
-   return this.versionEntry(index).locator('button', { hasText: 'rm' });
+   return this.versionEntry(index).locator('button', { hasText: /^rm$/i });
  }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/e2e/page-objects/dialogs/details-dialog.page.ts` around lines 259 -
275, The hasText predicates in versionDownloadBtn, versionRestoreBtn, and
versionDeleteBtn use plain strings which perform substring/case-insensitive
matches; replace those with anchored regexes (e.g., /^dl$/i, /^restore$/i,
/^rm$/i or variants that allow surrounding whitespace) so Playwright matches the
whole button text exactly and avoids accidental matches like "confirm" or
"form".
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tests/e2e/tests/full-workflow.spec.ts`:
- Around line 1230-1257: The 6.6.1 test ("6.6.1 Version history visible in
Details dialog") can time out because waitForVersionSection({ timeout: 30000 })
uses most of Playwright's default 30s; add a test.setTimeout(60000) at the start
of that test to match its sibling tests and allow the remaining operations to
complete. Locate the test by the string "6.6.1 Version history visible in
Details dialog" and add the single-line call to test.setTimeout(60000) before
any awaits (e.g., before fileList.rightClickItem or before calling
detailsDialog.waitForOpen) so waitForVersionSection and subsequent assertions
have sufficient time.
- Around line 1222-1339: Add a 60s test timeout to the "6.6.1 Version history
visible in Details dialog" test by calling test.setTimeout(60000) at the start
of that test (before awaiting detailsDialog.waitForVersionSection). This mirrors
sibling tests (6.6.2/6.6.3) and gives extra headroom for
detailsDialog.waitForVersionSection and the subsequent assertions (references:
test '6.6.1 Version history visible in Details dialog', test.setTimeout,
detailsDialog.waitForVersionSection).

---

Nitpick comments:
In `@tests/e2e/page-objects/dialogs/details-dialog.page.ts`:
- Around line 259-275: The hasText predicates in versionDownloadBtn,
versionRestoreBtn, and versionDeleteBtn use plain strings which perform
substring/case-insensitive matches; replace those with anchored regexes (e.g.,
/^dl$/i, /^restore$/i, /^rm$/i or variants that allow surrounding whitespace) so
Playwright matches the whole button text exactly and avoids accidental matches
like "confirm" or "form".

Comment thread tests/e2e/tests/full-workflow.spec.ts
Comment thread tests/e2e/tests/full-workflow.spec.ts
FSM1 and others added 3 commits February 19, 2026 21:01
Add test.setTimeout(60000) to test 6.6.1 for consistency with sibling
tests 6.6.2/6.6.3, and use anchored regex in version button locators
to prevent unintended substring matches.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The navigateIntoFolder helper had a 15s breadcrumb timeout which is too
tight for cold IPNS resolution in CI. After page reload, navigating into
a folder not previously visited requires a fresh IPNS resolve that can
exceed 15s under CI load. Bumped to 30s (consistent with content-load
timeouts) and added 90s test timeout for test 3.10 which does cold nav +
upload + round-trip verification.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@FSM1 FSM1 merged commit 6d3541b into main Feb 19, 2026
7 checks passed
@FSM1 FSM1 deleted the feat/quick-018-e2e-versioning branch February 21, 2026 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant