test(layout): lock upload-button gate against ANNOTATE_ALL-only users (#696)
Documents that the gate keys on lack of WRITE_ALL, not on being READ_ALL: an ANNOTATE_ALL-only user (canWrite=false) must still not see the upload link. The writer-sees-it contract is already covered by the existing upload-link tests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -90,6 +90,16 @@ describe('Layout – upload link', () => {
|
||||
.element(page.getByRole('link', { name: /Hochladen|Upload|Subir/i }))
|
||||
.not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('is hidden for an ANNOTATE_ALL-only user (gate is lack of WRITE_ALL, not READ_ALL)', async () => {
|
||||
render(Layout, {
|
||||
data: makeData({ canWrite: false, canAnnotate: true }),
|
||||
children: emptySnippet
|
||||
});
|
||||
await expect
|
||||
.element(page.getByRole('link', { name: /Hochladen|Upload|Subir/i }))
|
||||
.not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
// ─── Dropdown ─────────────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user