mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-27 14:59:27 +08:00
Fix tests
This commit is contained in:
parent
b8fc54643a
commit
e1f6a5f877
@ -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¶mB=cool', pasteType: 'text/plain' })
|
||||
.find('a')
|
||||
.should('contain', 'https://example.com?paramA=nice¶mB=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/')
|
||||
})
|
||||
|
@ -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¶mB=cool', pasteType: 'text/plain' })
|
||||
.find('a')
|
||||
.should('contain', 'https://example.com?paramA=nice¶mB=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/')
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user