Skip to content

Commit

Permalink
update api-core-tests to handle extenstions that add shipping (#37239)
Browse files Browse the repository at this point in the history
  • Loading branch information
nigeljamesstevenson committed Mar 20, 2023
1 parent 185cd3d commit e74abef
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: update

Update playwright api-core-tests to handle cases where extensions add to shipping methods
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ test.describe('Payment Gateways API tests', () => {
"default": "",
"tip": "If COD is only available for certain methods, set it up here. Leave blank to enable for all methods.",
"placeholder": "",
"options": {
"options": expect.objectContaining({
"Flat rate": {
"flat_rate": "Any "Flat rate" method"
},
Expand All @@ -145,7 +145,7 @@ test.describe('Payment Gateways API tests', () => {
"Local pickup": {
"local_pickup": "Any "Local pickup" method"
}
}
})
},
"enable_for_virtual": {
"id": "enable_for_virtual",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ test.describe('Shipping methods API tests', () => {
const responseJSON = await response.json();
expect(response.status()).toEqual(200);
expect(Array.isArray(responseJSON)).toBe(true);
expect(responseJSON.length).toEqual(3);
expect(responseJSON.length).toBeGreaterThanOrEqual(3);
expect(responseJSON[0].id).toEqual("flat_rate");
expect(responseJSON[1].id).toEqual("free_shipping");
expect(responseJSON[2].id).toEqual("local_pickup");
Expand Down

0 comments on commit e74abef

Please sign in to comment.