fix(tests): add assertion for each valid/invalid link (#3815)

* fix(tests): add assertion for each valid/invalid link

* chore(tests): disable video generation
This commit is contained in:
Dominik 2023-03-03 11:35:05 +01:00 committed by GitHub
parent b2ec51374d
commit f5895c63c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 10 deletions

View File

@ -24,15 +24,15 @@ context('/src/Examples/AutolinkValidation/React/', () => {
'https://tiptap.dev',
]
it('valid links should get autolinked', () => {
validLinks.forEach(([rawTextInput, textThatShouldBeLinked]) => {
cy.get('.ProseMirror').type(`{selectall}{backspace}${rawTextInput}`)
validLinks.forEach(([rawTextInput, textThatShouldBeLinked]) => {
it(`should autolink ${rawTextInput}`, () => {
cy.get('.ProseMirror').type(rawTextInput)
cy.get('.ProseMirror a').contains(textThatShouldBeLinked)
})
})
it('invalid links should not get autolinked', () => {
invalidLinks.forEach(rawTextInput => {
invalidLinks.forEach(rawTextInput => {
it(`should not autolink ${rawTextInput}`, () => {
cy.get('.ProseMirror').type(`{selectall}{backspace}${rawTextInput}`)
cy.get('.ProseMirror a').should('not.exist')
})

View File

@ -24,15 +24,15 @@ context('/src/Examples/AutolinkValidation/Vue/', () => {
'https://tiptap.dev',
]
it('valid links should get autolinked', () => {
validLinks.forEach(([rawTextInput, textThatShouldBeLinked]) => {
cy.get('.ProseMirror').type(`{selectall}{backspace}${rawTextInput}`)
validLinks.forEach(([rawTextInput, textThatShouldBeLinked]) => {
it(`should autolink ${rawTextInput}`, () => {
cy.get('.ProseMirror').type(rawTextInput)
cy.get('.ProseMirror a').contains(textThatShouldBeLinked)
})
})
it('invalid links should not get autolinked', () => {
invalidLinks.forEach(rawTextInput => {
invalidLinks.forEach(rawTextInput => {
it(`should not autolink ${rawTextInput}`, () => {
cy.get('.ProseMirror').type(`{selectall}{backspace}${rawTextInput}`)
cy.get('.ProseMirror a').should('not.exist')
})

View File

@ -2,6 +2,7 @@ const { defineConfig } = require('cypress')
module.exports = defineConfig({
defaultCommandTimeout: 12000,
video: false,
e2e: {
setupNodeEvents(on, config) {
return require('./cypress/plugins/index.js')(on, config)