Skip to content

Commit d385641

Browse files
authored
Added missing await to expect() calls in acceptance tests (#26767)
no refs This is a test only change. ## Summary - Added `await` to 6 Playwright async matcher assertions across 2 test files - Fixed `expect().toBeVisible()` assertions in offers.test.ts (4 instances) - Fixed `expect().toContainText()` assertions in recommendations.test.ts (2 instances) - All 208 acceptance tests now pass
1 parent 8df2622 commit d385641

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

apps/admin-x-settings/test/acceptance/membership/offers.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ test.describe('Offers', () => {
6262
const modal = page.getByTestId('offers-modal');
6363
await modal.getByRole('button', {name: 'New offer'}).click();
6464
const addModal = page.getByTestId('add-offer-modal');
65-
expect(addModal).toBeVisible();
65+
await expect(addModal).toBeVisible();
6666
const sidebar = addModal.getByTestId('add-offer-sidebar');
67-
expect(sidebar).toBeVisible();
67+
await expect(sidebar).toBeVisible();
6868
await sidebar.getByPlaceholder(/^Black Friday$/).fill('Coffee Tuesdays');
6969
await sidebar.getByLabel('Amount off').fill('5');
7070

@@ -135,9 +135,9 @@ test.describe('Offers', () => {
135135
const modal = page.getByTestId('offers-modal');
136136
await modal.getByRole('button', {name: 'New offer'}).click();
137137
const addModal = page.getByTestId('add-offer-modal');
138-
expect(addModal).toBeVisible();
138+
await expect(addModal).toBeVisible();
139139
const sidebar = addModal.getByTestId('add-offer-sidebar');
140-
expect(sidebar).toBeVisible();
140+
await expect(sidebar).toBeVisible();
141141
await sidebar.getByPlaceholder(/^Black Friday$/).fill('Coffee Tuesdays');
142142
await sidebar.getByLabel('Amount off').fill('10');
143143
await addModal.getByRole('button', {name: 'Publish'}).click();

apps/admin-x-settings/test/acceptance/membership/recommendations.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ test.describe('Recommendations', async () => {
162162

163163
// Confirm delete
164164
const confirmation = page.getByTestId('confirmation-modal');
165-
expect(confirmation).toContainText('Delete recommendation');
166-
expect(confirmation).toContainText('Your recommendation Recommendation 1 title will no longer be visible to your audience.');
165+
await expect(confirmation).toContainText('Delete recommendation');
166+
await expect(confirmation).toContainText('Your recommendation Recommendation 1 title will no longer be visible to your audience.');
167167

168168
await confirmation.getByRole('button', {name: 'Delete'}).click();
169169

0 commit comments

Comments
 (0)