🛂(frontend) right pad editor

Manage the right on the pad editor.
If a use cannot edit a pad, the pad editor will
be read-only. It will not save automatically.
A message will be displayed to the user.
This commit is contained in:
Anthony LC
2024-05-24 17:39:28 +02:00
committed by Anthony LC
parent dd33c99532
commit d5d374c311
5 changed files with 51 additions and 5 deletions

View File

@@ -168,4 +168,33 @@ test.describe('Pad Editor', () => {
await expect(page.getByText('Hello World Pad persisted 2')).toBeVisible();
});
test('it cannot edit if not the owner', async ({ page, browserName }) => {
const [padName] = await createPad(
page,
'pad-right-edit',
browserName,
1,
true,
);
await page.getByText('My account').click();
await page.getByText('Logout').first().click();
await page.getByLabel('Restart login').click();
const browserNames = ['chromium', 'webkit'];
const newBrowserName = browserNames.find((name) => name !== browserName)!;
await keyCloakSignIn(page, newBrowserName);
const panel = page.getByLabel('Pads panel').first();
await panel.getByText(padName).click();
await expect(
page.getByText(
"Read only, you don't have the right to update this document.",
),
).toBeVisible();
});
});