mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
test(many): add await to async asserts (#26456)
This commit is contained in:
@ -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');
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -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();
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user