mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-02-23 14:51:38 +00:00
fix: remove race conditions in word-count e2e test
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
702bc17f9d
commit
d44c0c6a7e
1 changed files with 7 additions and 8 deletions
|
@ -11,33 +11,32 @@ describe('Test word count with', () => {
|
||||||
|
|
||||||
it('empty note', () => {
|
it('empty note', () => {
|
||||||
cy.setCodemirrorContent('')
|
cy.setCodemirrorContent('')
|
||||||
cy.wait(500)
|
|
||||||
cy.getByCypressId('sidebar-btn-document-info').click()
|
cy.getByCypressId('sidebar-btn-document-info').click()
|
||||||
cy.getByCypressId('document-info-modal').should('be.visible')
|
cy.getByCypressId('document-info-modal').should('be.visible')
|
||||||
cy.getByCypressId('document-info-word-count').should('have.text', '0')
|
cy.getByCypressId('document-info-word-count').contains('0')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('simple words', () => {
|
it('simple words', () => {
|
||||||
cy.setCodemirrorContent('five words should be enough')
|
cy.setCodemirrorContent('five words should be enough')
|
||||||
cy.wait(500)
|
cy.getMarkdownBody().contains('five words should be enough')
|
||||||
cy.getByCypressId('sidebar-btn-document-info').click()
|
cy.getByCypressId('sidebar-btn-document-info').click()
|
||||||
cy.getByCypressId('document-info-modal').should('be.visible')
|
cy.getByCypressId('document-info-modal').should('be.visible')
|
||||||
cy.getByCypressId('document-info-word-count').should('have.text', '5')
|
cy.getByCypressId('document-info-word-count').contains('5')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('excluded codeblocks', () => {
|
it('excluded codeblocks', () => {
|
||||||
cy.setCodemirrorContent('```\nthis is should be ignored\n```\n\ntwo `words`')
|
cy.setCodemirrorContent('```\nthis is should be ignored\n```\n\ntwo `words`')
|
||||||
cy.wait(500)
|
cy.getMarkdownBody().contains('two words')
|
||||||
cy.getByCypressId('sidebar-btn-document-info').click()
|
cy.getByCypressId('sidebar-btn-document-info').click()
|
||||||
cy.getByCypressId('document-info-modal').should('be.visible')
|
cy.getByCypressId('document-info-modal').should('be.visible')
|
||||||
cy.getByCypressId('document-info-word-count').should('have.text', '2')
|
cy.getByCypressId('document-info-word-count').contains('2')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('excluded images', () => {
|
it('excluded images', () => {
|
||||||
cy.setCodemirrorContent(' not ignored text')
|
cy.setCodemirrorContent(' not ignored text')
|
||||||
cy.wait(500)
|
cy.getMarkdownBody().contains('not ignored text')
|
||||||
cy.getByCypressId('sidebar-btn-document-info').click()
|
cy.getByCypressId('sidebar-btn-document-info').click()
|
||||||
cy.getByCypressId('document-info-modal').should('be.visible')
|
cy.getByCypressId('document-info-modal').should('be.visible')
|
||||||
cy.getByCypressId('document-info-word-count').should('have.text', '3')
|
cy.getByCypressId('document-info-word-count').contains('3')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue