Skip to content

Commit 77a7a4f

Browse files
committed
adapt tests to performance improvement
1 parent 18746ab commit 77a7a4f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

test/helpers/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const BUTTON_SELECTOR = '.primary.button'
33
const RESET_SELECTOR = '.negative.button'
44
const PROGRESS_SELECTOR = '#progress'
55
const RESPONSE_MSG = 'You must give a response'
6-
const questionSelector = num => `.card:nth-child(${num})`
6+
const questionSelector = num => `#question_${num-1}`
77

88
module.exports = {
99
data,

test/quiz.spec.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ describe('Quiz', () => {
4040
client.expect.element(questionSelector(1))
4141
.to.be.visible
4242
client.expect.element(questionSelector(2))
43-
.to.not.be.visible
43+
.to.not.be.present
4444
client.expect.element(questionSelector(3))
45-
.to.not.be.visible
45+
.to.not.be.present
4646
})
4747

4848
it('should display description of the question', (client) => {
@@ -81,7 +81,7 @@ describe('Quiz', () => {
8181

8282
it('should display the next question', (client) => {
8383
client.expect.element(questionSelector(1))
84-
.to.not.be.visible
84+
.to.not.be.present
8585
client.expect.element(questionSelector(2))
8686
.to.be.visible
8787
})
@@ -102,7 +102,7 @@ describe('Quiz', () => {
102102

103103
it('should display the last non answered question', (client) => {
104104
client.expect.element(questionSelector(1))
105-
.to.not.be.visible
105+
.to.not.be.present
106106
client.expect.element(questionSelector(2))
107107
.to.be.visible
108108
})
@@ -120,7 +120,7 @@ describe('Quiz', () => {
120120
client.expect.element(questionSelector(1))
121121
.to.be.visible
122122
client.expect.element(questionSelector(2))
123-
.to.not.be.visible
123+
.to.not.be.present
124124
})
125125
})
126126
})

0 commit comments

Comments
 (0)