fix(integration-tests): Use asymmetric matcher for arrays in tests (#1992)
This commit is contained in:
@@ -162,17 +162,20 @@ describe("/admin/regions", () => {
|
||||
console.log(err)
|
||||
})
|
||||
|
||||
expect(response.data.regions).toEqual([
|
||||
expect.objectContaining({
|
||||
id: "test-region-updated-1",
|
||||
}),
|
||||
expect.objectContaining({
|
||||
id: "test-region",
|
||||
}),
|
||||
expect.objectContaining({
|
||||
id: "test-region-updated",
|
||||
}),
|
||||
])
|
||||
expect(response.data.regions).toHaveLength(3)
|
||||
expect(response.data.regions).toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
id: "test-region-updated-1",
|
||||
}),
|
||||
expect.objectContaining({
|
||||
id: "test-region",
|
||||
}),
|
||||
expect.objectContaining({
|
||||
id: "test-region-updated",
|
||||
}),
|
||||
])
|
||||
)
|
||||
expect(response.status).toEqual(200)
|
||||
})
|
||||
|
||||
@@ -189,14 +192,17 @@ describe("/admin/regions", () => {
|
||||
console.log(err)
|
||||
})
|
||||
|
||||
expect(response.data.regions).toEqual([
|
||||
expect.objectContaining({
|
||||
id: "test-region",
|
||||
}),
|
||||
expect.objectContaining({
|
||||
id: "test-region-updated",
|
||||
}),
|
||||
])
|
||||
expect(response.data.regions).toHaveLength(2)
|
||||
expect(response.data.regions).toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
id: "test-region",
|
||||
}),
|
||||
expect.objectContaining({
|
||||
id: "test-region-updated",
|
||||
}),
|
||||
])
|
||||
)
|
||||
expect(response.status).toEqual(200)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user