Merge remote-tracking branch 'origin/main' into chore/sync-with-main-6

This commit is contained in:
amandaesmith3
2023-05-05 13:30:21 -05:00
1333 changed files with 8602 additions and 6610 deletions

View File

@ -1,42 +0,0 @@
import { expect } from '@playwright/test';
import { test } from '@utils/test/playwright';
import { pullToRefresh } from '../test.utils';
// TODO FW-2795: Enable this test when touch events/gestures are better supported in Playwright
test.skip('refresher: basic', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/src/components/refresher/test/basic');
});
test.describe('legacy refresher', () => {
test('should load more items when performing a pull-to-refresh', async ({ page }) => {
const items = page.locator('ion-item');
expect(await items.count()).toBe(30);
await pullToRefresh(page);
expect(await items.count()).toBe(60);
});
});
test.describe('native refresher', () => {
test('should load more items when performing a pull-to-refresh', async ({ page }) => {
const refresherContent = page.locator('ion-refresher-content');
refresherContent.evaluateHandle((el: any) => {
// Resets the pullingIcon to enable the native refresher
el.pullingIcon = undefined;
});
await page.waitForChanges();
const items = page.locator('ion-item');
expect(await items.count()).toBe(30);
await pullToRefresh(page);
expect(await items.count()).toBe(60);
});
});
});

View File

@ -0,0 +1,48 @@
import { expect } from '@playwright/test';
import { configs, test } from '@utils/test/playwright';
import { pullToRefresh } from '../test.utils';
// TODO FW-2795: Enable this test when touch events/gestures are better supported in Playwright
/**
* This behavior does not vary across directions.
*/
configs({ directions: ['ltr'] }).forEach(({ title, config }) => {
test.describe.skip(title('refresher: basic'), () => {
test.beforeEach(async ({ page }) => {
await page.goto('/src/components/refresher/test/basic', config);
});
test.describe('legacy refresher', () => {
test('should load more items when performing a pull-to-refresh', async ({ page }) => {
const items = page.locator('ion-item');
expect(await items.count()).toBe(30);
await pullToRefresh(page);
expect(await items.count()).toBe(60);
});
});
test.describe('native refresher', () => {
test('should load more items when performing a pull-to-refresh', async ({ page }) => {
const refresherContent = page.locator('ion-refresher-content');
refresherContent.evaluateHandle((el: any) => {
// Resets the pullingIcon to enable the native refresher
el.pullingIcon = undefined;
});
await page.waitForChanges();
const items = page.locator('ion-item');
expect(await items.count()).toBe(30);
await pullToRefresh(page);
expect(await items.count()).toBe(60);
});
});
});
});

View File

@ -1,43 +0,0 @@
import { expect } from '@playwright/test';
import { test } from '@utils/test/playwright';
import { pullToRefresh } from '../test.utils';
// TODO FW-2795: Enable this test when touch events/gestures are better supported in Playwright
test.skip('refresher: custom scroll target', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/src/components/refresher/test/scroll-target');
});
test.describe('legacy refresher', () => {
test('should load more items when performing a pull-to-refresh', async ({ page }) => {
const items = page.locator('ion-item');
expect(await items.count()).toBe(30);
await pullToRefresh(page, '#inner-scroll');
expect(await items.count()).toBe(60);
});
});
test.describe('native refresher', () => {
test('should load more items when performing a pull-to-refresh', async ({ page }) => {
const refresherContent = page.locator('ion-refresher-content');
refresherContent.evaluateHandle((el: any) => {
// Resets the pullingIcon to enable the native refresher
el.pullingIcon = undefined;
});
await page.waitForChanges();
const items = page.locator('ion-item');
expect(await items.count()).toBe(30);
await pullToRefresh(page, '#inner-scroll');
expect(await items.count()).toBe(60);
});
});
});

View File

@ -0,0 +1,48 @@
import { expect } from '@playwright/test';
import { configs, test } from '@utils/test/playwright';
import { pullToRefresh } from '../test.utils';
// TODO FW-2795: Enable this test when touch events/gestures are better supported in Playwright
/**
* This behavior does not vary across directions.
*/
configs({ directions: ['ltr'] }).forEach(({ title, config }) => {
test.describe.skip(title('refresher: custom scroll target'), () => {
test.beforeEach(async ({ page }) => {
await page.goto('/src/components/refresher/test/scroll-target', config);
});
test.describe('legacy refresher', () => {
test('should load more items when performing a pull-to-refresh', async ({ page }) => {
const items = page.locator('ion-item');
expect(await items.count()).toBe(30);
await pullToRefresh(page, '#inner-scroll');
expect(await items.count()).toBe(60);
});
});
test.describe('native refresher', () => {
test('should load more items when performing a pull-to-refresh', async ({ page }) => {
const refresherContent = page.locator('ion-refresher-content');
refresherContent.evaluateHandle((el: any) => {
// Resets the pullingIcon to enable the native refresher
el.pullingIcon = undefined;
});
await page.waitForChanges();
const items = page.locator('ion-item');
expect(await items.count()).toBe(30);
await pullToRefresh(page, '#inner-scroll');
expect(await items.count()).toBe(60);
});
});
});
});