Skip to content

Commit

Permalink
attempt to reduce a bit of test flakiness?
Browse files Browse the repository at this point in the history
  • Loading branch information
etrepum committed May 10, 2024
1 parent d5b6ea8 commit 58a94e6
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ import {
assertSelection,
click,
copyToClipboard,
expect,
focusEditor,
html,
initialize,
locate,
pasteFromClipboard,
test,
} from '../../../utils/index.mjs';
Expand Down Expand Up @@ -77,6 +79,7 @@ test.describe('HTML Links CopyAndPaste', () => {
);

await click(page, '.link');
await expect(locate(page, '.link-input')).toBeFocused();
await page.keyboard.type('facebook.com');
await click(page, '.link-confirm');

Expand Down
22 changes: 22 additions & 0 deletions packages/lexical-playground/__tests__/e2e/Toolbar.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,28 @@ test.describe('Toolbar', () => {

// Add caption
await insertSampleImage(page);
// Catch flakiness earlier
await assertHTML(
page,
html`
<p>
<span contenteditable="false" data-lexical-decorator="true">
<div draggable="false">
<img
alt="Yellow flower in tilt shift lens"
draggable="false"
src="${SAMPLE_IMAGE_URL}" />
</div>
</span>
<br />
</p>
`,
undefined,
{
ignoreClasses: true,
ignoreInlineStyles: true,
},
);
await click(page, '.editor-image img');
await click(page, '.image-caption-button');
await focus(page, '.ImageNode__contentEditable');
Expand Down
7 changes: 7 additions & 0 deletions packages/lexical-playground/__tests__/utils/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ async function exposeLexicalEditor(page) {
).toBeVisible();
}),
);
// Ensure that they started up with the correct empty state
await assertHTML(
page,
html`
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
`,
);
}
const leftFrame = getPageOrFrame(page);
await leftFrame.waitForSelector('.tree-view-output pre');
Expand Down

0 comments on commit 58a94e6

Please sign in to comment.