(app-impress) add basic blocknotes editor

Create PadEditor, the parent component for the editors.
We integrate the BlockNoteEditor into the PadEditor.
This commit is contained in:
Anthony LC
2024-04-04 15:29:41 +02:00
committed by Anthony LC
parent da273d6b2b
commit 79831154be
7 changed files with 68 additions and 154 deletions

View File

@@ -0,0 +1,20 @@
import { expect, test } from '@playwright/test';
import { keyCloakSignIn } from './common';
test.beforeEach(async ({ page, browserName }) => {
await page.goto('/');
await keyCloakSignIn(page, browserName);
});
test.describe('Pad Editor', () => {
test('checks the Pad Editor interact correctly', async ({ page }) => {
await page.getByText('My mocked pad').first().click();
await expect(page.locator('h2').getByText('My mocked pad')).toBeVisible();
await page.locator('.ProseMirror.bn-editor').click();
await page.locator('.ProseMirror.bn-editor').fill('Hello World');
await expect(page.getByText('Hello World')).toBeVisible();
});
});

View File

@@ -1,62 +0,0 @@
import { expect, test } from '@playwright/test';
import { createTeam, keyCloakSignIn, randomName } from './common';
test.beforeEach(async ({ page, browserName }) => {
await page.goto('/');
await keyCloakSignIn(page, browserName);
});
test.describe('Team', () => {
test('checks all the top box elements are visible', async ({
page,
browserName,
}) => {
const teamName = (
await createTeam(page, 'team-top-box', browserName, 1)
).shift();
await expect(page.getByLabel('icon group')).toBeVisible();
await expect(
page.getByRole('heading', {
name: `Members of “${teamName}`,
level: 3,
}),
).toBeVisible();
await expect(
page.getByText(`Add people to the “${teamName}“ group.`),
).toBeVisible();
await expect(page.getByText(`1 member`)).toBeVisible();
const today = new Date(Date.now());
const todayFormated = today.toLocaleDateString('en', {
month: '2-digit',
day: '2-digit',
year: 'numeric',
});
await expect(page.getByText(`Created at ${todayFormated}`)).toBeVisible();
await expect(
page.getByText(`Last update at ${todayFormated}`),
).toBeVisible();
});
test('it updates the team name', async ({ page, browserName }) => {
await createTeam(page, 'team-update-name', browserName, 1);
await page.getByLabel(`Open the team options`).click();
await page.getByRole('button', { name: `Update the team` }).click();
const teamName = randomName('new-team-update-name', browserName, 1)[0];
await page.getByText('New name...', { exact: true }).fill(teamName);
await page
.getByRole('button', { name: 'Validate the modification' })
.click();
await expect(page.getByText('The team has been updated.')).toBeVisible();
await expect(
page.getByText(`Add people to the “${teamName}“ group.`),
).toBeVisible();
});
});