mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-27 06:01:54 +03:00
Lexical: Updated tests after link changes
This commit is contained in:
@ -273,18 +273,6 @@ describe('LexicalAutoAutoLinkNode tests', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test('AutoLinkNode.createDOM() sanitizes javascript: URLs', async () => {
|
|
||||||
const {editor} = testEnv;
|
|
||||||
|
|
||||||
await editor.update(() => {
|
|
||||||
// eslint-disable-next-line no-script-url
|
|
||||||
const autoLinkNode = new AutoLinkNode('javascript:alert(0)');
|
|
||||||
expect(autoLinkNode.createDOM(editorConfig).outerHTML).toBe(
|
|
||||||
'<a href="about:blank" class="my-autolink-class"></a>',
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
test('AutoLinkNode.updateDOM()', async () => {
|
test('AutoLinkNode.updateDOM()', async () => {
|
||||||
const {editor} = testEnv;
|
const {editor} = testEnv;
|
||||||
|
|
||||||
|
@ -218,18 +218,6 @@ describe('LexicalLinkNode tests', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test('LinkNode.createDOM() sanitizes javascript: URLs', async () => {
|
|
||||||
const {editor} = testEnv;
|
|
||||||
|
|
||||||
await editor.update(() => {
|
|
||||||
// eslint-disable-next-line no-script-url
|
|
||||||
const linkNode = new LinkNode('javascript:alert(0)');
|
|
||||||
expect(linkNode.createDOM(editorConfig).outerHTML).toBe(
|
|
||||||
'<a href="about:blank" class="my-link-class"></a>',
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
test('LinkNode.updateDOM()', async () => {
|
test('LinkNode.updateDOM()', async () => {
|
||||||
const {editor} = testEnv;
|
const {editor} = testEnv;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user