hedgedoc/cypress/integration/language.spec.ts
Erik Michelson d725b65140
Cypress-IDs and prettier for tests (#1634)
* Add cy.getById method and run prettier

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2021-11-19 18:04:04 +01:00

28 lines
808 B
TypeScript

/*
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { languages } from '../fixtures/languages'
describe('Languages', () => {
beforeEach(() => {
cy.visit('/')
})
it('all languages are available', () => {
cy.getById('language-picker').find('option').as('languages')
cy.get('@languages').should('have.length', 28)
languages.forEach((language) => {
cy.get('@languages').contains(language)
})
})
it('language changes affect the UI', () => {
cy.getById('language-picker').select('English')
cy.getById('new-note-button').find('span').contains('New note')
cy.getById('language-picker').select('Deutsch')
cy.getById('new-note-button').find('span').contains('Neue Notiz')
})
})