Skip to content

Commit

Permalink
fix: permission
Browse files Browse the repository at this point in the history
  • Loading branch information
taro-shono committed Oct 25, 2024
1 parent e3114e8 commit 7b023df
Showing 1 changed file with 29 additions and 26 deletions.
55 changes: 29 additions & 26 deletions packages/lexical-playground/__tests__/e2e/Links.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2086,33 +2086,36 @@ test.describe('Link attributes', () => {
page,
context,
hasLinkAttributes,
browserName,
}) => {
await focusEditor(page);
await page.keyboard.type('Hello awesome');
await focusEditor(page);
await selectAll(page);
await context.grantPermissions(['clipboard-read', 'clipboard-write']);
await page.evaluate(() =>
navigator.clipboard.writeText('https://facebook.com'),
);
await paste(page);
await assertHTML(
page,
html`
<p
class="PlaygroundEditorTheme__paragraph PlaygroundEditorTheme__ltr"
dir="ltr">
<a
class="PlaygroundEditorTheme__link PlaygroundEditorTheme__ltr"
dir="ltr"
href="https://facebook.com"
rel="noopener noreferrer"
target="_blank">
<span data-lexical-text="true">Hello awesome</span>
</a>
</p>
`,
);
if (browserName === 'chromium') {
await focusEditor(page);
await page.keyboard.type('Hello awesome');
await focusEditor(page);
await selectAll(page);
await context.grantPermissions(['clipboard-read', 'clipboard-write']);
await page.evaluate(() =>
navigator.clipboard.writeText('https://facebook.com'),
);
await paste(page);
await assertHTML(
page,
html`
<p
class="PlaygroundEditorTheme__paragraph PlaygroundEditorTheme__ltr"
dir="ltr">
<a
class="PlaygroundEditorTheme__link PlaygroundEditorTheme__ltr"
dir="ltr"
href="https://facebook.com"
rel="noopener noreferrer"
target="_blank">
<span data-lexical-text="true">Hello awesome</span>
</a>
</p>
`,
);
}
});
});

Expand Down

0 comments on commit 7b023df

Please sign in to comment.