From 6485a5fcb4388391945c0a6a6b24629769222e09 Mon Sep 17 00:00:00 2001 From: Jan Thurau Date: Fri, 17 Nov 2023 10:20:13 +0100 Subject: [PATCH] fixes tests in marks/link --- demos/src/Marks/Link/React/index.spec.js | 30 ++++++++++++------------ demos/src/Marks/Link/Vue/index.spec.js | 30 ++++++++++++------------ 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/demos/src/Marks/Link/React/index.spec.js b/demos/src/Marks/Link/React/index.spec.js index 20e1f87c8..89babc8d2 100644 --- a/demos/src/Marks/Link/React/index.spec.js +++ b/demos/src/Marks/Link/React/index.spec.js @@ -7,7 +7,7 @@ context('/src/Marks/Link/React/', () => { beforeEach(() => { cy.get('.tiptap').then(([{ editor }]) => { - editor.commands.setContent('

Example Text

') + editor.commands.setContent('

Example TextDEFAULT

') cy.get('.tiptap').type('{selectall}') }) }) @@ -26,27 +26,27 @@ context('/src/Marks/Link/React/', () => { it('should parse a tags correctly', () => { cy.get('.tiptap').then(([{ editor }]) => { - editor.commands.setContent('

Example Text

') + editor.commands.setContent('

Example Text1

') expect(editor.getHTML()).to.eq( - '

Example Text

', + '

Example Text1

', ) }) }) it('should parse a tags with target attribute correctly', () => { cy.get('.tiptap').then(([{ editor }]) => { - editor.commands.setContent('

Example Text

') + editor.commands.setContent('

Example Text2

') expect(editor.getHTML()).to.eq( - '

Example Text

', + '

Example Text2

', ) }) }) it('should parse a tags with rel attribute correctly', () => { cy.get('.tiptap').then(([{ editor }]) => { - editor.commands.setContent('

Example Text

') + editor.commands.setContent('

Example Text3

') expect(editor.getHTML()).to.eq( - '

Example Text

', + '

Example Text3

', ) }) }) @@ -61,7 +61,7 @@ context('/src/Marks/Link/React/', () => { cy.get('.tiptap') .find('a') - .should('contain', 'Example Text') + .should('contain', 'https://tiptap.dev') .should('have.attr', 'href', 'https://tiptap.dev') }) }) @@ -69,27 +69,27 @@ context('/src/Marks/Link/React/', () => { it('detects a pasted URL within a text', () => { cy.get('.tiptap') .paste({ - pastePayload: 'some text https://example.com around an url', + pastePayload: 'some text https://example1.com around an url', pasteType: 'text/plain', }) .find('a') - .should('contain', 'https://example.com') - .should('have.attr', 'href', 'https://example.com') + .should('contain', 'https://example1.com') + .should('have.attr', 'href', 'https://example1.com') }) it('detects a pasted URL', () => { cy.get('.tiptap') - .paste({ pastePayload: 'https://example.com', pasteType: 'text/plain' }) + .paste({ pastePayload: 'https://example2.com', pasteType: 'text/plain' }) .find('a') - .should('contain', 'Example Text') - .should('have.attr', 'href', 'https://example.com') + .should('contain', 'https://example2.com') + .should('have.attr', 'href', 'https://example2.com') }) it('detects a pasted URL with query params', () => { cy.get('.tiptap') .paste({ pastePayload: 'https://example.com?paramA=nice¶mB=cool', pasteType: 'text/plain' }) .find('a') - .should('contain', 'Example Text') + .should('contain', 'https://example.com?paramA=nice¶mB=cool') .should('have.attr', 'href', 'https://example.com?paramA=nice¶mB=cool') }) diff --git a/demos/src/Marks/Link/Vue/index.spec.js b/demos/src/Marks/Link/Vue/index.spec.js index 46ae00410..2938d87fc 100644 --- a/demos/src/Marks/Link/Vue/index.spec.js +++ b/demos/src/Marks/Link/Vue/index.spec.js @@ -5,29 +5,29 @@ context('/src/Marks/Link/Vue/', () => { beforeEach(() => { cy.get('.tiptap').then(([{ editor }]) => { - editor.commands.setContent('

Example Text

') + editor.commands.setContent('

Example TextDEFAULT

') cy.get('.tiptap').type('{selectall}') }) }) it('should parse a tags correctly', () => { cy.get('.tiptap').then(([{ editor }]) => { - editor.commands.setContent('

Example Text

') - expect(editor.getHTML()).to.eq('

Example Text

') + editor.commands.setContent('

Example Text1

') + expect(editor.getHTML()).to.eq('

Example Text1

') }) }) it('should parse a tags with target attribute correctly', () => { cy.get('.tiptap').then(([{ editor }]) => { - editor.commands.setContent('

Example Text

') - expect(editor.getHTML()).to.eq('

Example Text

') + editor.commands.setContent('

Example Text2

') + expect(editor.getHTML()).to.eq('

Example Text2

') }) }) it('should parse a tags with rel attribute correctly', () => { cy.get('.tiptap').then(([{ editor }]) => { - editor.commands.setContent('

Example Text

') - expect(editor.getHTML()).to.eq('

Example Text

') + editor.commands.setContent('

Example Text3

') + expect(editor.getHTML()).to.eq('

Example Text3

') }) }) @@ -42,30 +42,30 @@ context('/src/Marks/Link/Vue/', () => { cy.get('.tiptap') .find('a') - .should('contain', 'Example Text') + .should('contain', 'Example TextDEFAULT') .should('have.attr', 'href', 'https://tiptap.dev') }) }) it('detects a pasted URL within a text', () => { - cy.get('.tiptap').paste({ pastePayload: 'some text https://example.com around an url', pasteType: 'text/plain' }) + cy.get('.tiptap').paste({ pastePayload: 'some text https://example1.com around an url', pasteType: 'text/plain' }) .find('a') - .should('contain', 'https://example.com') - .should('have.attr', 'href', 'https://example.com') + .should('contain', 'https://example1.com') + .should('have.attr', 'href', 'https://example1.com') }) it('detects a pasted URL', () => { - cy.get('.tiptap').paste({ pastePayload: 'https://example.com', pasteType: 'text/plain' }) + cy.get('.tiptap').paste({ pastePayload: 'https://example2.com', pasteType: 'text/plain' }) .find('a') - .should('contain', 'Example Text') - .should('have.attr', 'href', 'https://example.com') + .should('contain', 'https://example2.com') + .should('have.attr', 'href', 'https://example2.com') }) it('detects a pasted URL with query params', () => { cy.get('.tiptap') .paste({ pastePayload: 'https://example.com?paramA=nice¶mB=cool', pasteType: 'text/plain' }) .find('a') - .should('contain', 'Example Text') + .should('contain', 'https://example.com?paramA=nice¶mB=cool') .should('have.attr', 'href', 'https://example.com?paramA=nice¶mB=cool') })