From f5895c63c44b9e567c0b53142ffa3bc502fcc26f Mon Sep 17 00:00:00 2001 From: Dominik <6538827+bdbch@users.noreply.github.com> Date: Fri, 3 Mar 2023 11:35:05 +0100 Subject: [PATCH] fix(tests): add assertion for each valid/invalid link (#3815) * fix(tests): add assertion for each valid/invalid link * chore(tests): disable video generation --- .../Examples/AutolinkValidation/React/index.spec.js | 10 +++++----- .../src/Examples/AutolinkValidation/Vue/index.spec.js | 10 +++++----- tests/cypress.config.js | 1 + 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/demos/src/Examples/AutolinkValidation/React/index.spec.js b/demos/src/Examples/AutolinkValidation/React/index.spec.js index d958b21f1..753c5d3b5 100644 --- a/demos/src/Examples/AutolinkValidation/React/index.spec.js +++ b/demos/src/Examples/AutolinkValidation/React/index.spec.js @@ -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') }) diff --git a/demos/src/Examples/AutolinkValidation/Vue/index.spec.js b/demos/src/Examples/AutolinkValidation/Vue/index.spec.js index c204b8ae9..aff78544b 100644 --- a/demos/src/Examples/AutolinkValidation/Vue/index.spec.js +++ b/demos/src/Examples/AutolinkValidation/Vue/index.spec.js @@ -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') }) diff --git a/tests/cypress.config.js b/tests/cypress.config.js index 2eab003fa..299e89c5b 100644 --- a/tests/cypress.config.js +++ b/tests/cypress.config.js @@ -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)