Skip to content

Commit b6a9181

Browse files
committed
Rewrite cypress test
Signed-off-by: Louis Chemineau <louis@chmn.me>
1 parent 57770ae commit b6a9181

File tree

1 file changed

+22
-19
lines changed

1 file changed

+22
-19
lines changed

cypress/integration/settings.spec.js

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ describe('Check that user\'s settings survive a reload', () => {
3838
})
3939

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

4343
cy.reload()
4444

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

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

9797
it('Activity summary survive a reload', () => {
98-
let input = cy.get("#app-content").contains("Send daily activity summary in the morning").parentsUntil('.settings-section').children('input')
99-
100-
input.check({force: true})
101-
input.should('be.checked')
102-
103-
cy.reload()
104-
input = cy.get("#app-content").contains("Send daily activity summary in the morning").parentsUntil('.settings-section').children('input')
105-
106-
input.should('be.checked')
107-
108-
input.uncheck({force: true})
109-
110-
cy.reload()
111-
input = cy.get("#app-content").contains("Send daily activity summary in the morning").parentsUntil('.settings-section').children('input')
112-
113-
input.should('not.be.checked')
98+
cy.get("#app-content")
99+
.contains("Send daily activity summary in the morning")
100+
.find('input')
101+
.check({ force: true })
102+
.should('be.checked')
103+
.wait(1000)
104+
.reload()
105+
106+
cy.get("#app-content")
107+
.contains("Send daily activity summary in the morning")
108+
.find('input')
109+
.should('be.checked')
110+
.uncheck({ force: true })
111+
.reload()
112+
113+
cy.get("#app-content")
114+
.contains("Send daily activity summary in the morning")
115+
.find('input')
116+
.should('not.be.checked')
114117
})
115118
})

0 commit comments

Comments
 (0)