Fix tests

This commit is contained in:
Cameron Hessler 2023-12-03 00:34:31 -06:00
parent b8fc54643a
commit e1f6a5f877
2 changed files with 16 additions and 1 deletions

View File

@ -79,6 +79,7 @@ context('/src/Marks/Link/React/', () => {
it('detects a pasted URL', () => {
cy.get('.tiptap')
.type('{backspace}')
.paste({ pastePayload: 'https://example2.com', pasteType: 'text/plain' })
.find('a')
.should('contain', 'https://example2.com')
@ -87,6 +88,7 @@ context('/src/Marks/Link/React/', () => {
it('detects a pasted URL with query params', () => {
cy.get('.tiptap')
.type('{backspace}')
.paste({ pastePayload: 'https://example.com?paramA=nice&paramB=cool', pasteType: 'text/plain' })
.find('a')
.should('contain', 'https://example.com?paramA=nice&paramB=cool')
@ -95,9 +97,14 @@ context('/src/Marks/Link/React/', () => {
it('correctly links multiple pasted HTML urls', () => {
cy.get('.tiptap')
.type('{backspace}')
.paste({ pastePayload: '<a href="https://duckduckgo.com/">https://duckduckgo.com/</a><a href="https://www.bing.com/">https://www.bing.com/</a>', pasteType: 'text/html' })
cy.get('.tiptap')
.find('a[href="https://duckduckgo.com/"]')
.should('contain', 'https://duckduckgo.com/')
cy.get('.tiptap')
.find('a[href="https://www.bing.com/"]')
.should('contain', 'https://www.bing.com/')
})

View File

@ -55,7 +55,9 @@ context('/src/Marks/Link/Vue/', () => {
})
it('detects a pasted URL', () => {
cy.get('.tiptap').paste({ pastePayload: 'https://example2.com', pasteType: 'text/plain' })
cy.get('.tiptap')
.type('{backspace}')
.paste({ pastePayload: 'https://example2.com', pasteType: 'text/plain' })
.find('a')
.should('contain', 'https://example2.com')
.should('have.attr', 'href', 'https://example2.com')
@ -63,6 +65,7 @@ context('/src/Marks/Link/Vue/', () => {
it('detects a pasted URL with query params', () => {
cy.get('.tiptap')
.type('{backspace}')
.paste({ pastePayload: 'https://example.com?paramA=nice&paramB=cool', pasteType: 'text/plain' })
.find('a')
.should('contain', 'https://example.com?paramA=nice&paramB=cool')
@ -71,9 +74,14 @@ context('/src/Marks/Link/Vue/', () => {
it('correctly links multiple pasted HTML urls', () => {
cy.get('.tiptap')
.type('{backspace}')
.paste({ pastePayload: '<a href="https://duckduckgo.com/">https://duckduckgo.com/</a><a href="https://www.bing.com/">https://www.bing.com/</a>', pasteType: 'text/html' })
cy.get('.tiptap')
.find('a[href="https://duckduckgo.com/"]')
.should('contain', 'https://duckduckgo.com/')
cy.get('.tiptap')
.find('a[href="https://www.bing.com/"]')
.should('contain', 'https://www.bing.com/')
})