mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 07:04:45 -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
|
@ -13,58 +13,48 @@ describe('Intro page', () => {
|
|||
|
||||
describe('customizable content', () => {
|
||||
it('fetches and shows the correct intro page content', () => {
|
||||
cy.getMarkdownBody()
|
||||
.contains('test content')
|
||||
cy.getMarkdownBody().contains('test content')
|
||||
})
|
||||
|
||||
it('won\'t show anything if no content was found', () => {
|
||||
it("won't show anything if no content was found", () => {
|
||||
cy.intercept('/mock-backend/public/intro.md', {
|
||||
statusCode: 404
|
||||
})
|
||||
cy.visit('/')
|
||||
|
||||
cy.get(`iframe[data-cypress-id="documentIframe"]`)
|
||||
.should('not.exist')
|
||||
cy.getById('documentIframe').should('not.exist')
|
||||
})
|
||||
})
|
||||
|
||||
describe('features button', () => {
|
||||
it('is hidden when logged in', () => {
|
||||
cy.get('[data-cypress-id="features-button"]')
|
||||
.should('not.exist')
|
||||
cy.getById('features-button').should('not.exist')
|
||||
})
|
||||
|
||||
it('is visible when logged out', () => {
|
||||
cy.logout()
|
||||
cy.get('[data-cypress-id="features-button"]')
|
||||
.should('exist')
|
||||
cy.getById('features-button').should('exist')
|
||||
})
|
||||
})
|
||||
|
||||
describe('sign in button', () => {
|
||||
it('is hidden when logged in', () => {
|
||||
cy.get('[data-cypress-id="sign-in-button"]')
|
||||
.should('not.exist')
|
||||
cy.getById('sign-in-button').should('not.exist')
|
||||
})
|
||||
|
||||
it('is visible when logged out', () => {
|
||||
cy.logout()
|
||||
cy.get('[data-cypress-id="sign-in-button"]')
|
||||
.should('exist')
|
||||
cy.getById('sign-in-button').should('exist')
|
||||
})
|
||||
})
|
||||
|
||||
describe('version dialog', () => {
|
||||
it('can be opened and closed', () => {
|
||||
cy.get('[data-cypress-id="version-modal"]')
|
||||
.should('not.exist')
|
||||
cy.get('[data-cypress-id="show-version-modal"]')
|
||||
.click()
|
||||
cy.get('[data-cypress-id="version-modal"]')
|
||||
.should('be.visible')
|
||||
cy.get('[data-cypress-id="version-modal"] .modal-header .close')
|
||||
.click()
|
||||
cy.get('[data-cypress-id="version-modal"]')
|
||||
.should('not.exist')
|
||||
cy.getById('version-modal').should('not.exist')
|
||||
cy.getById('show-version-modal').click()
|
||||
cy.getById('version-modal').should('be.visible')
|
||||
cy.getById('version-modal').find('.modal-header .close').click()
|
||||
cy.getById('version-modal').should('not.exist')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue