mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-08 23:58:13 +08:00
chore(playwright): enable type checking (#25034)
This commit is contained in:
@ -1,10 +1,11 @@
|
||||
import { testLoading } from '../test.utils';
|
||||
import { newE2EPage } from '@stencil/core/testing';
|
||||
|
||||
import { testLoading } from '../test.utils';
|
||||
|
||||
const DIRECTORY = 'basic';
|
||||
const getActiveElementText = async (page) => {
|
||||
const getActiveElementText = async page => {
|
||||
const activeElement = await page.evaluateHandle(() => document.activeElement);
|
||||
return await page.evaluate(el => el && el.textContent, activeElement);
|
||||
return page.evaluate(el => el && el.textContent, activeElement);
|
||||
}
|
||||
|
||||
test('loading: focus trap', async () => {
|
||||
@ -13,7 +14,7 @@ test('loading: focus trap', async () => {
|
||||
await page.click('#html-content-loading');
|
||||
await page.waitForSelector('#html-content-loading');
|
||||
|
||||
let loading = await page.find('ion-loading');
|
||||
const loading = await page.find('ion-loading');
|
||||
|
||||
expect(loading).not.toBe(null);
|
||||
await loading.waitForVisible();
|
||||
@ -102,12 +103,12 @@ test('loading: htmlAttributes', async () => {
|
||||
await page.click('#basic-loading');
|
||||
await page.waitForSelector('#basic-loading');
|
||||
|
||||
let alert = await page.find('ion-loading');
|
||||
const alert = await page.find('ion-loading');
|
||||
|
||||
expect(alert).not.toBe(null);
|
||||
await alert.waitForVisible();
|
||||
|
||||
const attribute = await page.evaluate((el) => document.querySelector('ion-loading').getAttribute('data-testid'));
|
||||
const attribute = await page.evaluate(el => document.querySelector('ion-loading').getAttribute('data-testid'));
|
||||
|
||||
expect(attribute).toEqual('basic-loading');
|
||||
});
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
import { newE2EPage } from '@stencil/core/testing';
|
||||
|
||||
import { generateE2EUrl } from '@utils/test';
|
||||
|
||||
export const testLoading = async (
|
||||
|
||||
Reference in New Issue
Block a user