mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-06-11 20:23:36 +08:00
test: use id for tests
This commit is contained in:
parent
a2eea24b5b
commit
bfcf6d94e8
@ -6,23 +6,23 @@ context('/src/Examples/Transition/Vue/', () => {
|
||||
it('should not have an active tiptap instance but a button', () => {
|
||||
cy.get('.tiptap').should('not.exist')
|
||||
|
||||
cy.get('button').should('exist')
|
||||
cy.get('#toggle-editor').should('exist')
|
||||
})
|
||||
|
||||
it('clicking the button should show the editor', () => {
|
||||
cy.get('button').click()
|
||||
cy.get('#toggle-editor').click()
|
||||
|
||||
cy.get('.tiptap').should('exist')
|
||||
cy.get('.tiptap').should('be.visible')
|
||||
})
|
||||
|
||||
it('clicking the button again should hide the editor', () => {
|
||||
cy.get('button').click()
|
||||
cy.get('#toggle-editor').click()
|
||||
|
||||
cy.get('.tiptap').should('exist')
|
||||
cy.get('.tiptap').should('be.visible')
|
||||
|
||||
cy.get('button').click()
|
||||
cy.get('#toggle-editor').click()
|
||||
|
||||
cy.get('.tiptap').should('not.exist')
|
||||
})
|
||||
|
@ -34,7 +34,12 @@ const showEditor = ref(false)
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<button type="button" @click="showEditor = !showEditor" style="margin-bottom: 1rem;">
|
||||
<button
|
||||
type="button"
|
||||
@click="showEditor = !showEditor"
|
||||
style="margin-bottom: 1rem;"
|
||||
id="toggle-editor"
|
||||
>
|
||||
{{ showEditor ? 'Hide editor' : 'Show editor' }}
|
||||
</button>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user