🛂(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:
@@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user