test(many): add await to async asserts (#26456)

This commit is contained in:
Liam DeBeasi
2022-12-09 10:36:19 -05:00
committed by GitHub
parent 378ae41124
commit 3481c44b2f
9 changed files with 40 additions and 40 deletions

View File

@ -14,21 +14,21 @@ test.describe('datetime-button: switching to correct view', () => {
});
test('should switch to a date-only view when the date button is clicked', async ({ page }) => {
const datetime = page.locator('ion-datetime');
expect(datetime).toHaveJSProperty('presentation', 'date-time');
await expect(datetime).toHaveJSProperty('presentation', 'date-time');
await page.locator('#date-button').click();
await page.waitForChanges();
expect(datetime).toHaveJSProperty('presentation', 'date');
await expect(datetime).toHaveJSProperty('presentation', 'date');
});
test('should switch to a time-only view when the time button is clicked', async ({ page }) => {
const datetime = page.locator('ion-datetime');
expect(datetime).toHaveJSProperty('presentation', 'date-time');
await expect(datetime).toHaveJSProperty('presentation', 'date-time');
await page.locator('#time-button').click();
await page.waitForChanges();
expect(datetime).toHaveJSProperty('presentation', 'time');
await expect(datetime).toHaveJSProperty('presentation', 'time');
});
});

View File

@ -68,38 +68,38 @@ test.describe('datetime-button: popover', () => {
await ionPopoverDidPresent.next();
expect(datetime).toBeVisible();
await expect(datetime).toBeVisible();
});
test('should open the time popover', async ({ page }) => {
await page.locator('#time-button').click();
await ionPopoverDidPresent.next();
expect(datetime).toBeVisible();
await expect(datetime).toBeVisible();
});
test('should open the date popover then the time popover', async ({ page }) => {
await page.locator('#date-button').click();
await ionPopoverDidPresent.next();
expect(datetime).toBeVisible();
await expect(datetime).toBeVisible();
await popover.evaluate((el: HTMLIonPopoverElement) => el.dismiss());
await ionPopoverDidDismiss.next();
await page.locator('#time-button').click();
await ionPopoverDidPresent.next();
expect(datetime).toBeVisible();
await expect(datetime).toBeVisible();
});
test('should open the time popover then the date popover', async ({ page }) => {
await page.locator('#time-button').click();
await ionPopoverDidPresent.next();
expect(datetime).toBeVisible();
await expect(datetime).toBeVisible();
await popover.evaluate((el: HTMLIonPopoverElement) => el.dismiss());
await ionPopoverDidDismiss.next();
await page.locator('#date-button').click();
await ionPopoverDidPresent.next();
expect(datetime).toBeVisible();
await expect(datetime).toBeVisible();
});
});
@ -130,37 +130,37 @@ test.describe('datetime-button: modal', () => {
await ionModalDidPresent.next();
expect(datetime).toBeVisible();
await expect(datetime).toBeVisible();
});
test('should open the time modal', async ({ page }) => {
await page.locator('#time-button').click();
await ionModalDidPresent.next();
expect(datetime).toBeVisible();
await expect(datetime).toBeVisible();
});
test('should open the date modal then the time modal', async ({ page }) => {
await page.locator('#date-button').click();
await ionModalDidPresent.next();
expect(datetime).toBeVisible();
await expect(datetime).toBeVisible();
await modal.evaluate((el: HTMLIonModalElement) => el.dismiss());
await ionModalDidDismiss.next();
await page.locator('#time-button').click();
await ionModalDidPresent.next();
expect(datetime).toBeVisible();
await expect(datetime).toBeVisible();
});
test('should open the time modal then the date modal', async ({ page }) => {
await page.locator('#time-button').click();
await ionModalDidPresent.next();
expect(datetime).toBeVisible();
await expect(datetime).toBeVisible();
await modal.evaluate((el: HTMLIonModalElement) => el.dismiss());
await ionModalDidDismiss.next();
await page.locator('#date-button').click();
await ionModalDidPresent.next();
expect(datetime).toBeVisible();
await expect(datetime).toBeVisible();
});
});