fix: Upgrade cozy-viewer to 28.1.18 + e2e tests#3953
Conversation
cozy-viewer 28.1.6 → 28.1.18 - linagora/cozy-libs#3040
Add a Playwright e2e test that opens a file inside a federated shared folder and checks that the viewer access panel lists the inherited sharing members.
There was a problem hiding this comment.
Gates Passed
3 Quality Gates Passed
See analysis details in CodeScene
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.
Walkthrough
Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
BundleMonFiles updated (1)
Unchanged files (19)
Total files change +303B +0.01% Groups updated (1)
Unchanged groups (2)
Final result: ✅ View report in BundleMon website ➡️ |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
e2e/pages/FileViewerPage.ts (1)
22-24: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winScope member checks to the access panel to avoid false positives.
Line 23 searches the whole page (
getByText(member).first()), so unrelated text can satisfy the assertion. Prefer scoping the locator to the sharing/access panel container.🤖 Prompt for 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. In `@e2e/pages/FileViewerPage.ts` around lines 22 - 24, The loop iterating through members uses this.page.getByText(member).first() which searches the entire page and can match unrelated text, causing false positives. Instead of searching the whole page, scope the locator to the access panel or sharing panel container by first getting a reference to that container element, then calling getByText(member) on that specific container rather than on this.page. This ensures the member visibility assertions only check within the intended panel.
🤖 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 `@e2e/pages/FileViewerPage.ts`:
- Around line 18-20: The assertion checking for the exact text "Who has access?"
in the access panel verification is not aligned with the actual locale contract,
which uses a count-based title format like "1 person has access" or
"%{smart_count} people have access". Update the expect statement around line 19
to assert for a locale-stable heading instead of the hardcoded text. Consider
checking for a more stable selector or pattern that matches the count-based
title format used by the actual component, or identify a different stable
element within the access panel that doesn't depend on the specific locale text.
---
Nitpick comments:
In `@e2e/pages/FileViewerPage.ts`:
- Around line 22-24: The loop iterating through members uses
this.page.getByText(member).first() which searches the entire page and can match
unrelated text, causing false positives. Instead of searching the whole page,
scope the locator to the access panel or sharing panel container by first
getting a reference to that container element, then calling getByText(member) on
that specific container rather than on this.page. This ensures the member
visibility assertions only check within the intended panel.
🪄 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: 0aa96d8e-1518-4224-9708-1db215a27733
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (3)
e2e/pages/FileViewerPage.tse2e/tests/z-viewer-sharing-access.spec.tspackage.json
cozy-viewer 28.1.6 → 28.1.18
Add a e2e test that opens a file inside a federated
shared folder and checks that the viewer access panel lists the
inherited sharing members.
Summary by CodeRabbit
Tests
Chores