mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-18 17:25:16 -04:00
Cypress-IDs and prettier for tests (#1634)
* Add cy.getById method and run prettier Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
parent
8a8bacc0aa
commit
d725b65140
53 changed files with 758 additions and 1203 deletions
|
@ -12,32 +12,32 @@ describe('Test word count with', () => {
|
|||
it('empty note', () => {
|
||||
cy.setCodemirrorContent('')
|
||||
cy.wait(500)
|
||||
cy.get('[data-cypress-id="sidebar-btn-document-info"]').click()
|
||||
cy.get('[data-cypress-id="document-info-modal"]').should('be.visible')
|
||||
cy.get('[data-cypress-id="document-info-word-count"]').should('have.text', '0')
|
||||
cy.getById('sidebar-btn-document-info').click()
|
||||
cy.getById('document-info-modal').should('be.visible')
|
||||
cy.getById('document-info-word-count').should('have.text', '0')
|
||||
})
|
||||
|
||||
it('simple words', () => {
|
||||
cy.setCodemirrorContent('five words should be enough')
|
||||
cy.wait(500)
|
||||
cy.get('[data-cypress-id="sidebar-btn-document-info"]').click()
|
||||
cy.get('[data-cypress-id="document-info-modal"]').should('be.visible')
|
||||
cy.get('[data-cypress-id="document-info-word-count"]').should('have.text', '5')
|
||||
cy.getById('sidebar-btn-document-info').click()
|
||||
cy.getById('document-info-modal').should('be.visible')
|
||||
cy.getById('document-info-word-count').should('have.text', '5')
|
||||
})
|
||||
|
||||
it('excluded codeblocks', () => {
|
||||
cy.setCodemirrorContent('```\nthis is should be ignored\n```\n\ntwo `words`')
|
||||
cy.wait(500)
|
||||
cy.get('[data-cypress-id="sidebar-btn-document-info"]').click()
|
||||
cy.get('[data-cypress-id="document-info-modal"]').should('be.visible')
|
||||
cy.get('[data-cypress-id="document-info-word-count"]').should('have.text', '2')
|
||||
cy.getById('sidebar-btn-document-info').click()
|
||||
cy.getById('document-info-modal').should('be.visible')
|
||||
cy.getById('document-info-word-count').should('have.text', '2')
|
||||
})
|
||||
|
||||
it('excluded images', () => {
|
||||
cy.setCodemirrorContent(' not ignored text')
|
||||
cy.wait(500)
|
||||
cy.get('[data-cypress-id="sidebar-btn-document-info"]').click()
|
||||
cy.get('[data-cypress-id="document-info-modal"]').should('be.visible')
|
||||
cy.get('[data-cypress-id="document-info-word-count"]').should('have.text', '3')
|
||||
cy.getById('sidebar-btn-document-info').click()
|
||||
cy.getById('document-info-modal').should('be.visible')
|
||||
cy.getById('document-info-word-count').should('have.text', '3')
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue