Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(refresher): attach scroll listener to custom scroll target (#25335)
Resolves #25318
- Loading branch information
1 parent
15f0c06
commit 8f5e4cd
Showing
14 changed files
with
188 additions
and
275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { expect } from '@playwright/test'; | ||
import { test } from '@utils/test/playwright'; | ||
|
||
import { pullToRefresh } from '../test.utils'; | ||
|
||
test.describe('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); | ||
}); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
core/src/components/refresher/test/scroll-target/refresher.e2e.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { expect } from '@playwright/test'; | ||
import { test } from '@utils/test/playwright'; | ||
|
||
import { pullToRefresh } from '../test.utils'; | ||
|
||
test.describe('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); | ||
}); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.