Skip to content

fix: Upgrade cozy-viewer to 28.1.18 + e2e tests#3953

Merged
doubleface merged 2 commits into
masterfrom
fix/updateViewer28118
Jun 23, 2026
Merged

fix: Upgrade cozy-viewer to 28.1.18 + e2e tests#3953
doubleface merged 2 commits into
masterfrom
fix/updateViewer28118

Conversation

@doubleface

@doubleface doubleface commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

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

    • Added comprehensive end-to-end tests for the file viewer's sharing access panel functionality, validating that team members are correctly displayed when accessing files within nested subfolders, with proper test cleanup procedures.
  • Chores

    • Updated cozy-viewer dependency to the latest compatible version for improved stability and performance.

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.
@doubleface doubleface added the e2e Run the E2E suite on this PR label Jun 23, 2026

@codescene-delta-analysis codescene-delta-analysis 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.

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.

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

FileViewerPage gains an expectWhoHasAccessWith(members) method that imports Playwright's expect and asserts the "Who has access?" heading and each provided member matcher are visible in the viewer. A new test file z-viewer-sharing-access.spec.ts uses this method: it generates unique drive and subfolder names, uploads a copy of sample.txt into a subfolder, shares the folder with Bob via createAndShareFolderWithBob, and then asserts the viewer's sharing-access panel displays "You" and a case-insensitive match for "bob". Temporary file cleanup is ensured with try/finally and safeUnlink. The cozy-viewer dependency is bumped from ^28.1.6 to ^28.1.18.

Possibly related PRs

  • linagora/twake-drive#3828: Introduces the FileViewerPage page object that this PR extends with the expectWhoHasAccessWith method.

Suggested reviewers

  • JF-Cozy
  • zatteo
  • rezk2ll
  • lethemanh
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: upgrading cozy-viewer and adding e2e tests for the viewer's access panel functionality.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/updateViewer28118

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.

@bundlemon

bundlemon Bot commented Jun 23, 2026

Copy link
Copy Markdown

BundleMon

Files updated (1)
Status Path Size Limits
static/js/cozy.(hash).js
928.66KB (+306B +0.03%) -
Unchanged files (19)
Status Path Size Limits
static/resource/(hash).js
336.09KB -
services/qualificationMigration.js
283.39KB -
services/dacc.js
263.13KB -
static/js/main.(hash).js
48.85KB -
static/js/lib-react.(hash).js
43.88KB -
static/css/cozy.(hash).css
30.13KB -
static/js/lib-polyfill.(hash).js
22.77KB -
static/js/lib-router.(hash).js
21.86KB -
static/js/public.(hash).js
19.77KB -
static/css/main.(hash).css
13.57KB -
static/js/intents.(hash).js
8.99KB -
static/js/(chunkId).(hash).js
8.6KB -
static/js/async/(chunkId).(hash).js
7.5KB -
manifest.webapp
3.09KB -
static/css/public.(hash).css
2.34KB -
index.html
770B -
public/index.html
706B -
intents/index.html
643B -
assets/manifest.json
185B -

Total files change +303B +0.01%

Groups updated (1)
Status Path Size Limits
**/*.js
5.98MB (+306B 0%) -
Unchanged groups (2)
Status Path Size Limits
**/*.{png,svg,ico}
2.16MB -
**/*.css
77.43KB -

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

@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: 1

🧹 Nitpick comments (1)
e2e/pages/FileViewerPage.ts (1)

22-24: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Scope 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

📥 Commits

Reviewing files that changed from the base of the PR and between cc6e23d and bf12047.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (3)
  • e2e/pages/FileViewerPage.ts
  • e2e/tests/z-viewer-sharing-access.spec.ts
  • package.json

Comment thread e2e/pages/FileViewerPage.ts
@doubleface doubleface merged commit d4fd793 into master Jun 23, 2026
7 checks passed
@doubleface doubleface deleted the fix/updateViewer28118 branch June 23, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e2e Run the E2E suite on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants