update api-core-tests to handle extenstions that add shipping (#37239)

This commit is contained in:
nigeljamesstevenson 2023-03-20 20:24:36 +00:00 committed by GitHub
parent 185cd3dcaa
commit e74abeffe4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 3 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: update
Update playwright api-core-tests to handle cases where extensions add to shipping methods

View File

@ -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"
},
@ -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",

View File

@ -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");