Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
C-Hess committed Dec 3, 2023
1 parent b8fc546 commit e1f6a5f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
7 changes: 7 additions & 0 deletions demos/src/Marks/Link/React/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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')
Expand All @@ -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/')
})
Expand Down
10 changes: 9 additions & 1 deletion demos/src/Marks/Link/Vue/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,17 @@ 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')
})

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')
Expand All @@ -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/')
})
Expand Down

0 comments on commit e1f6a5f

Please sign in to comment.