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
|
@ -17,31 +17,23 @@ describe('Task lists ', () => {
|
|||
describe('render with checkboxes ', () => {
|
||||
it('when unchecked', () => {
|
||||
cy.setCodemirrorContent(TEST_STRING_UNCHECKED)
|
||||
cy.getMarkdownBody()
|
||||
.find('input[type=checkbox]')
|
||||
.should('have.length', 6)
|
||||
cy.getMarkdownBody().find('input[type=checkbox]').should('have.length', 6)
|
||||
})
|
||||
|
||||
it('when checked lowercase', () => {
|
||||
cy.setCodemirrorContent(TEST_STRING_CHECKED_LOWER)
|
||||
cy.getMarkdownBody()
|
||||
.find('input[type=checkbox]')
|
||||
.should('have.length', 6)
|
||||
cy.getMarkdownBody().find('input[type=checkbox]').should('have.length', 6)
|
||||
})
|
||||
|
||||
it('when checked uppercase', () => {
|
||||
cy.setCodemirrorContent(TEST_STRING_CHECKED_UPPER)
|
||||
cy.getMarkdownBody()
|
||||
.find('input[type=checkbox]')
|
||||
.should('have.length', 6)
|
||||
cy.getMarkdownBody().find('input[type=checkbox]').should('have.length', 6)
|
||||
})
|
||||
})
|
||||
|
||||
it('do not render as checkboxes when invalid', () => {
|
||||
cy.setCodemirrorContent(TEST_STRING_INVALID)
|
||||
cy.getMarkdownBody()
|
||||
.find('input[type=checkbox]')
|
||||
.should('have.length', 0)
|
||||
cy.getMarkdownBody().find('input[type=checkbox]').should('have.length', 0)
|
||||
})
|
||||
|
||||
describe('are clickable and change the markdown source ', () => {
|
||||
|
@ -49,39 +41,30 @@ describe('Task lists ', () => {
|
|||
cy.setCodemirrorContent(TEST_STRING_UNCHECKED)
|
||||
cy.getMarkdownBody()
|
||||
.find('input[type=checkbox]')
|
||||
.each(box => {
|
||||
.each((box) => {
|
||||
box.trigger('click')
|
||||
})
|
||||
cy.get('.CodeMirror-line > span')
|
||||
.should('exist')
|
||||
.should('contain.text', '[x]')
|
||||
.should('not.contain.text', '[ ]')
|
||||
cy.get('.CodeMirror-line > span').should('exist').should('contain.text', '[x]').should('not.contain.text', '[ ]')
|
||||
})
|
||||
|
||||
it('from checked (lowercase) to unchecked', () => {
|
||||
cy.setCodemirrorContent(TEST_STRING_CHECKED_LOWER)
|
||||
cy.getMarkdownBody()
|
||||
.find('input[type=checkbox]')
|
||||
.each(box => {
|
||||
.each((box) => {
|
||||
box.trigger('click')
|
||||
})
|
||||
cy.get('.CodeMirror-line > span')
|
||||
.should('exist')
|
||||
.should('contain.text', '[ ]')
|
||||
.should('not.contain.text', '[x]')
|
||||
cy.get('.CodeMirror-line > span').should('exist').should('contain.text', '[ ]').should('not.contain.text', '[x]')
|
||||
})
|
||||
|
||||
it('from checked (uppercase) to unchecked', () => {
|
||||
cy.setCodemirrorContent(TEST_STRING_CHECKED_UPPER)
|
||||
cy.getMarkdownBody()
|
||||
.find('input[type=checkbox]')
|
||||
.each(box => {
|
||||
.each((box) => {
|
||||
box.trigger('click')
|
||||
})
|
||||
cy.get('.CodeMirror-line > span')
|
||||
.should('exist')
|
||||
.should('contain.text', '[ ]')
|
||||
.should('not.contain.text', '[X]')
|
||||
cy.get('.CodeMirror-line > span').should('exist').should('contain.text', '[ ]').should('not.contain.text', '[X]')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue