refactor: update tests url checking logic and comments

This commit is contained in:
Armando Guarino 2024-11-06 14:11:48 +01:00
parent 6bdb5917a5
commit 035862b698
2 changed files with 3 additions and 3 deletions

View File

@ -136,7 +136,7 @@ context('/src/Marks/Link/React/', () => {
disallowedProtocols.forEach(url => { disallowedProtocols.forEach(url => {
cy.get('.tiptap').then(([{ editor }]) => { cy.get('.tiptap').then(([{ editor }]) => {
editor.commands.setContent(`<p><a href="${url}">Example Text</a></p>`) editor.commands.setContent(`<p><a href="${url}">Example Text</a></p>`)
expect(editor.getHTML()).to.not.include(`<a href="${url}">`) expect(editor.getHTML()).to.not.include(url)
}) })
}) })
}) })
@ -147,7 +147,7 @@ context('/src/Marks/Link/React/', () => {
disallowedDomains.forEach(url => { disallowedDomains.forEach(url => {
cy.get('.tiptap').then(([{ editor }]) => { cy.get('.tiptap').then(([{ editor }]) => {
editor.commands.setContent(`<p><a href="${url}">Example Text</a></p>`) editor.commands.setContent(`<p><a href="${url}">Example Text</a></p>`)
expect(editor.getHTML()).to.not.include(`<a href="${url}">`) expect(editor.getHTML()).to.not.include(url)
}) })
}) })
}) })

View File

@ -73,7 +73,7 @@ export interface LinkOptions {
HTMLAttributes: Record<string, any> HTMLAttributes: Record<string, any>
/** /**
* A validation function that modifies link verification for the auto linker. * A validation function that modifies link verification.
* @param url - The url to be validated. * @param url - The url to be validated.
* @param ctx - An object containing: * @param ctx - An object containing:
* - `defaultValidate`: A function that performs the default URL validation. * - `defaultValidate`: A function that performs the default URL validation.