Skip to content

Commit

Permalink
Rewrite cypress test
Browse files Browse the repository at this point in the history
Signed-off-by: Louis Chemineau <louis@chmn.me>
  • Loading branch information
artonge committed Sep 13, 2022
1 parent 57770ae commit b6a9181
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions cypress/integration/settings.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ describe('Check that user\'s settings survive a reload', () => {
})

it('Form survive a reload', () => {
cy.get("#app-content input[type='checkbox']").uncheck({force: true}).should('not.be.checked')
cy.get("#app-content input[type='checkbox']").uncheck({ force: true }).should('not.be.checked')

cy.reload()

cy.get("#app-content input[type='checkbox']").uncheck({force: true}).should('not.be.checked')
cy.get("#app-content input[type='checkbox']").uncheck({ force: true }).should('not.be.checked')

cy.get("#file_changed_notification").check({force: true})
cy.get("#file_changed_notification").check({ force: true })
cy.contains("A calendar was modified").click()
cy.contains("Comments for files").click()
cy.contains("Your password or email was modified").click()
Expand Down Expand Up @@ -95,21 +95,24 @@ describe('Check that user\'s settings survive a reload', () => {
})

it('Activity summary survive a reload', () => {
let input = cy.get("#app-content").contains("Send daily activity summary in the morning").parentsUntil('.settings-section').children('input')

input.check({force: true})
input.should('be.checked')

cy.reload()
input = cy.get("#app-content").contains("Send daily activity summary in the morning").parentsUntil('.settings-section').children('input')

input.should('be.checked')

input.uncheck({force: true})

cy.reload()
input = cy.get("#app-content").contains("Send daily activity summary in the morning").parentsUntil('.settings-section').children('input')

input.should('not.be.checked')
cy.get("#app-content")
.contains("Send daily activity summary in the morning")
.find('input')
.check({ force: true })
.should('be.checked')
.wait(1000)
.reload()

cy.get("#app-content")
.contains("Send daily activity summary in the morning")
.find('input')
.should('be.checked')
.uncheck({ force: true })
.reload()

cy.get("#app-content")
.contains("Send daily activity summary in the morning")
.find('input')
.should('not.be.checked')
})
})

0 comments on commit b6a9181

Please sign in to comment.