mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-09 08:09:32 +08:00
chore(): sync with main
This commit is contained in:
@ -6,29 +6,19 @@ import { configs, test } from '@utils/test/playwright';
|
||||
*/
|
||||
configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) => {
|
||||
test.describe(title('picker: isOpen'), () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
test('should open and close the picker', async ({ page }) => {
|
||||
await page.goto('/src/components/picker/test/is-open', config);
|
||||
});
|
||||
|
||||
test('should open the picker', async ({ page }) => {
|
||||
const ionPickerDidPresent = await page.spyOnEvent('ionPickerDidPresent');
|
||||
const ionPickerDidDismiss = await page.spyOnEvent('ionPickerDidDismiss');
|
||||
const picker = page.locator('ion-picker');
|
||||
|
||||
await page.click('#default');
|
||||
|
||||
await ionPickerDidPresent.next();
|
||||
await expect(picker).toBeVisible();
|
||||
});
|
||||
|
||||
test('should open the picker then close after a timeout', async ({ page }) => {
|
||||
const ionPickerDidPresent = await page.spyOnEvent('ionPickerDidPresent');
|
||||
const ionPickerDidDismiss = await page.spyOnEvent('ionPickerDidDismiss');
|
||||
const picker = page.locator('ion-picker');
|
||||
|
||||
await page.click('#timeout');
|
||||
|
||||
await ionPickerDidPresent.next();
|
||||
await expect(picker).toBeVisible();
|
||||
await picker.evaluate((el: HTMLIonPickerElement) => (el.isOpen = false));
|
||||
|
||||
await ionPickerDidDismiss.next();
|
||||
await expect(picker).toBeHidden();
|
||||
|
||||
Reference in New Issue
Block a user