Skip to content

Commit 2fb6812

Browse files
committed
Tests e2e cypress DataViz API : compare arrays with have.same.members
1 parent 26286b6 commit 2fb6812

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tests/end2end/cypress/integration/dataviz-api-ghaction.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ describe('Dataviz API tests', function () {
1414
expect(resp.body).to.have.property('data')
1515
expect(resp.body.data).to.have.length(1)
1616
expect(resp.body.data[0]).to.have.property('type', 'bar')
17-
expect(resp.body.data[0]).to.have.property('x').to.deep.eq(["Grabels", "Clapiers", "Montferrier-sur-Lez", "Saint-Jean-de-Védas", "Lattes", "Montpellier", "Lavérune", "Juvignac", "Le Crès", "Castelnau-le-Lez"])
18-
expect(resp.body.data[0]).to.have.property('y').to.deep.eq([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
17+
expect(resp.body.data[0]).to.have.property('x').to.have.same.members(["Grabels", "Clapiers", "Montferrier-sur-Lez", "Saint-Jean-de-Védas", "Lattes", "Montpellier", "Lavérune", "Juvignac", "Le Crès", "Castelnau-le-Lez"])
18+
expect(resp.body.data[0]).to.have.property('y').to.have.same.members([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
1919
expect(resp.body).to.have.property('layout')
2020
})
2121
})
@@ -35,8 +35,8 @@ describe('Dataviz API tests', function () {
3535
expect(resp.body).to.have.property('data')
3636
expect(resp.body.data).to.have.length(1)
3737
expect(resp.body.data[0]).to.have.property('type', 'pie')
38-
expect(resp.body.data[0]).to.have.property('values').to.deep.eq([ 4, 2, 6, 1, 2, 1, 2, 1, 4, 2 ])
39-
expect(resp.body.data[0]).to.have.property('labels').to.deep.eq([ "Castelnau-le-Lez", "Clapiers", "Grabels", "Juvignac", "Lattes", "Lavérune", "Le Crès", "Montferrier-sur-Lez", "Montpellier", "Saint-Jean-de-Védas" ])
38+
expect(resp.body.data[0]).to.have.property('values').to.have.same.members([ 4, 2, 6, 1, 2, 1, 2, 1, 4, 2 ])
39+
expect(resp.body.data[0]).to.have.property('labels').to.have.same.members([ "Castelnau-le-Lez", "Clapiers", "Grabels", "Juvignac", "Lattes", "Lavérune", "Le Crès", "Montferrier-sur-Lez", "Montpellier", "Saint-Jean-de-Védas" ])
4040
expect(resp.body).to.have.property('layout')
4141
})
4242
})
@@ -71,7 +71,7 @@ describe('Dataviz API tests', function () {
7171
}
7272
]
7373
)
74-
expect(resp.body.data[0]).to.have.property('x').to.deep.eq([
74+
expect(resp.body.data[0]).to.have.property('x').to.have.same.members([
7575
1,
7676
16,
7777
68,
@@ -99,7 +99,7 @@ describe('Dataviz API tests', function () {
9999
199
100100
])
101101
expect(resp.body.data[0]).to.have.property('type', 'bar')
102-
expect(resp.body.data[0]).to.have.property('y').to.deep.eq([
102+
expect(resp.body.data[0]).to.have.property('y').to.have.same.members([
103103
"Grabels",
104104
"Grabels",
105105
"Montferrier-sur-Lez",
@@ -147,8 +147,8 @@ describe('Dataviz API tests', function () {
147147
expect(resp.body).to.have.property('data')
148148
expect(resp.body.data).to.have.length(1)
149149
expect(resp.body.data[0]).to.have.property('type', 'bar')
150-
expect(resp.body.data[0]).to.have.property('x').to.deep.eq([ 5, 5, 5, 5 ])
151-
expect(resp.body.data[0]).to.have.property('y').to.deep.eq([ 73, 79, 126, 195 ])
150+
expect(resp.body.data[0]).to.have.property('x').to.have.same.members([ 5, 5, 5, 5 ])
151+
expect(resp.body.data[0]).to.have.property('y').to.have.same.members([ 73, 79, 126, 195 ])
152152
expect(resp.body).to.have.property('layout')
153153
})
154154
})

0 commit comments

Comments
 (0)