Skip to content

Commit

Permalink
Fix the failed E2E test case introduced by pull request 2698.
Browse files Browse the repository at this point in the history
  • Loading branch information
eason9487 committed Dec 2, 2024
1 parent beac793 commit 74e3115
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
5 changes: 5 additions & 0 deletions tests/e2e/specs/dashboard/edit-free-listings.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ test.describe( 'Edit Free Listings', () => {
page = await browser.newPage();
dashboardPage = new DashboardPage( page );
editFreeListingsPage = new EditFreeListingsPage( page );

await editFreeListingsPage.fulfillSettings( {
shipping_rate: 'flat',
tax_rate: 'destination',
} );
await setOnboardedMerchant();
await dashboardPage.mockRequests();
await dashboardPage.goto();
Expand Down
12 changes: 4 additions & 8 deletions tests/e2e/specs/setup-mc/step-2-product-listings.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,10 @@ test.describe( 'Configure product listings', () => {
} ),

// Mock MC settings
productListingsPage.fulfillSettings(
{
shipping_rate: 'automatic',
tax_rate: 'destination',
},
200,
[ 'GET' ]
),
productListingsPage.fulfillSettings( {
shipping_rate: 'automatic',
tax_rate: 'destination',
} ),
] );

await productListingsPage.goto();
Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/utils/mock-requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,11 @@ export default class MockRequests {
* Fulfill the Settings request.
*
* @param {Object} payload
* @param {number} status
* @param {Array} methods
* @param {number} [status=200]
* @param {Array} [methods=['GET']]
* @return {Promise<void>}
*/
async fulfillSettings( payload, status = 200, methods = [] ) {
async fulfillSettings( payload, status = 200, methods = [ 'GET' ] ) {
await this.fulfillRequest(
/\/wc\/gla\/mc\/settings\b/,
payload,
Expand Down

0 comments on commit 74e3115

Please sign in to comment.