Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions test/e2e/tests/edit.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,12 @@ test('Add code mark', async ({ page }, workerInfo) => {
test.setTimeout(30000);
const url = getTestPageURL('edit5', workerInfo);
await page.goto(url);
await page.waitForTimeout(3000);
const proseMirror = page.locator('div.ProseMirror');
await proseMirror.waitFor();
await expect(proseMirror).toBeVisible();
await expect(proseMirror).toHaveAttribute('contenteditable', 'true');
await proseMirror.fill('This is a line that will contain a code mark.');
await page.waitForTimeout(1000);
await expect(proseMirror).toContainText('This is a line that will contain a code mark.');

// Forward
for (let i = 0; i < 10; i += 1) {
Expand All @@ -148,7 +147,6 @@ test('Add code mark', async ({ page }, workerInfo) => {
}
await page.keyboard.press('`');
// leave time for the code mark to be processed
await page.waitForTimeout(1000);
let codeElement = proseMirror.locator('code');
await codeElement.waitFor();
await expect(codeElement).toContainText('code');
Expand All @@ -164,7 +162,6 @@ test('Add code mark', async ({ page }, workerInfo) => {
await page.keyboard.press('ArrowLeft');
}
await page.keyboard.press('`');
await page.waitForTimeout(1000);
codeElement = proseMirror.locator('code');
await codeElement.waitFor();
await expect(codeElement).toContainText('code');
Expand All @@ -179,6 +176,5 @@ test('Add code mark', async ({ page }, workerInfo) => {
await page.keyboard.press('ArrowRight');
}
await page.keyboard.press('`');
await page.waitForTimeout(1000);
await expect(proseMirror).toContainText('This is a line that will contain `a code mark`.');
});
Loading