Skip to content

Commit

Permalink
add expect clause to ensure other items are not inluded
Browse files Browse the repository at this point in the history
  • Loading branch information
pKorsholm committed May 24, 2023
1 parent d344fb7 commit 356cbe8
Showing 1 changed file with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -561,20 +561,25 @@ describe("Inventory Items endpoints", () => {
adminHeaders
)

expect(response.data.inventory_items).toHaveLength(3)
expect(response.data.inventory_items).toEqual(
expect(response.data.inventory_items).not.toEqual(
expect.arrayContaining([
expect.objectContaining({
sku: "Test Sku",
}),
expect.objectContaining({
description: "Test Desc",
}),
expect.objectContaining({
title: "Test Item",
sku: "MY_SKU",
}),
])
)
expect(response.data.inventory_items).toHaveLength(3)
expect(response.data.inventory_items).toEqual([
expect.objectContaining({
sku: "Test Sku",
}),
expect.objectContaining({
description: "Test Desc",
}),
expect.objectContaining({
title: "Test Item",
}),
])
})
})

Expand Down

0 comments on commit 356cbe8

Please sign in to comment.