Skip to content

Commit 2431aa1

Browse files
author
Guillaume Chau
committed
test(e2e): fix
1 parent a0eacfa commit 2431aa1

File tree

3 files changed

+17
-19
lines changed

3 files changed

+17
-19
lines changed

cypress/integration/component-data-edit.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ suite('component data edit', () => {
44
it('should edit data using the decrease button', () => {
55
// select Instance
66
cy.get('.instance:nth-child(1) .instance:nth-child(2)').eq(0).click()
7+
cy.get('.component-state-inspector .data-type').should('contain', 'data')
78
cy.get('.data-field').eq(7).find('.actions .vue-ui-button').eq(1).click({ force: true })
89
cy.get('.component-state-inspector').within(() => {
910
cy.get('.key').contains('0').parent().get('.value').contains('0')
@@ -21,6 +22,7 @@ suite('component data edit', () => {
2122

2223
it('should edit data using the increase button', () => {
2324
cy.get('.instance:nth-child(1) .instance:nth-child(2)').eq(0).click()
25+
cy.get('.component-state-inspector .data-type').should('contain', 'data')
2426
cy.get('.data-field').eq(7).find('.actions .vue-ui-button').eq(2).click({ force: true })
2527
cy.get('.component-state-inspector').within(() => {
2628
cy.get('.key').contains('0').parent().get('.value').contains('0')

cypress/integration/components-tab.js

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -120,30 +120,27 @@ suite('components tab', () => {
120120
it('should display injected props', () => {
121121
cy.get('.left .search input').clear().type('Mine')
122122
cy.get('.instance').eq(1).click()
123-
cy.get('.right .data-wrapper').then(el => {
124-
expect(el.text()).to.contain('injected')
125-
expect(el.text()).to.contain('answer:42')
126-
expect(el.text()).to.contain('foo:"bar"')
127-
expect(el.text()).to.contain('noop:ƒ noop(a, b, c)')
128-
})
123+
cy.get('.right .data-wrapper')
124+
.should('contain', 'injected')
125+
.should('contain', 'answer:42')
126+
.should('contain', 'foo:"bar"')
127+
.should('contain', 'noop:ƒ noop(a, b, c)')
129128
cy.get('.left .search input').clear()
130129
})
131130

132131
it('should display $refs', () => {
133132
cy.get('.instance .item-name').contains('RefTester').click()
134-
cy.get('.right .data-wrapper').then(el => {
135-
expect(el.text()).to.contain('list:Array[4]')
136-
expect(el.text()).to.contain('<li>')
137-
expect(el.text()).to.contain('tester:<p id="testing"')
138-
})
133+
cy.get('.right .data-wrapper')
134+
.should('contain', 'list:Array[4]')
135+
.should('contain', '<li>')
136+
.should('contain', 'tester:<p id="testing"')
139137
})
140138

141139
it('should display $attrs', () => {
142140
cy.get('.instance .instance:nth-child(2) .arrow-wrapper').click()
143141
cy.get('.instance .instance .instance:nth-child(1) .item-name').click()
144-
cy.get('.right .data-wrapper').then(el => {
145-
expect(el.text()).to.contain('$attrs')
146-
expect(el.text()).to.contain('attr:"some-attr"')
147-
})
142+
cy.get('.right .data-wrapper')
143+
.should('contain', '$attrs')
144+
.should('contain', 'attr:"some-attr"')
148145
})
149146
})

cypress/integration/vuex-tab.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ suite('vuex tab', () => {
1414
cy.get('[data-id="load-vuex-state"]').click()
1515
cy.get('.recording-vuex-state').should('not.be.visible')
1616
cy.get('.loading-vuex-state').should('not.be.visible')
17-
cy.get('.vuex-state-inspector').then(el => {
18-
expect(el.text()).to.include('type:"DECREMENT"')
19-
expect(el.text()).to.include('count:1')
20-
})
17+
cy.get('.vuex-state-inspector')
18+
.should('contain', 'type:"DECREMENT"')
19+
.should('contain', 'count:1')
2120
cy.get('.history .entry').eq(5).should('have.class', 'inspected').should('have.class', 'active')
2221
})
2322

0 commit comments

Comments
 (0)