mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 23:24:46 -04:00
Add cypress id attribute only in test mode (#1566)
* Add function for test attribute Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> * Adjust components Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> * Fix naming of attribute Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> * Rename method Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> * Rename method, interface, attribute and use interface Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> * Lint and format fix Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
2abe40ef1d
commit
a398660c18
48 changed files with 229 additions and 167 deletions
|
@ -14,29 +14,29 @@ describe('The status bar text length info', () => {
|
|||
})
|
||||
|
||||
it('shows the maximal length of the document as number of available characters in the tooltip', () => {
|
||||
cy.get('.status-bar [data-cy="remainingCharacters"]')
|
||||
cy.get('.status-bar [data-cypress-id="remainingCharacters"]')
|
||||
.attribute('title')
|
||||
.should('contain', ' 200 ')
|
||||
})
|
||||
|
||||
it('color is set to "warning" on <= 100 characters remaining', () => {
|
||||
cy.setCodemirrorContent(warningTestContent)
|
||||
cy.get('.status-bar [data-cy="remainingCharacters"]')
|
||||
cy.get('.status-bar [data-cypress-id="remainingCharacters"]')
|
||||
.should('have.class', 'text-warning')
|
||||
})
|
||||
|
||||
it('color is set to danger on <= 0 characters remaining', () => {
|
||||
cy.setCodemirrorContent(dangerTestContent)
|
||||
cy.get('.status-bar [data-cy="remainingCharacters"]')
|
||||
cy.get('.status-bar [data-cypress-id="remainingCharacters"]')
|
||||
.should('have.class', 'text-danger')
|
||||
})
|
||||
|
||||
it('shows a warning and opens a modal', () => {
|
||||
cy.setCodemirrorContent(tooMuchTestContent)
|
||||
cy.get('[data-cy="limitReachedModal"]')
|
||||
cy.get('[data-cypress-id="limitReachedModal"]')
|
||||
.should('be.visible')
|
||||
cy.getIframeBody()
|
||||
.find('[data-cy="limitReachedMessage"]')
|
||||
.find('[data-cypress-id="limitReachedMessage"]')
|
||||
.should('be.visible')
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue