refactor(component): virtual rendering page list (#4775)

Co-authored-by: Joooye_34 <Joooye1991@gmail.com>
This commit is contained in:
Peng Xiao
2023-11-02 22:21:01 +08:00
committed by GitHub
parent a3906bf92b
commit 65321e39cc
33 changed files with 997 additions and 589 deletions

View File

@@ -38,10 +38,17 @@ const dateFormat = (date: Date) => {
return `${month} ${day}`;
};
export const checkPagesCount = async (page: Page, count: number) => {
expect(
(await page.locator('[data-testid="page-list-item"]').all()).length
).toBe(count);
// fixme: there could be multiple page lists in the Page
export const getPagesCount = async (page: Page) => {
const locator = page.locator('[data-testid="virtualized-page-list"]');
const pageListCount = await locator.count();
if (pageListCount === 0) {
return 0;
}
const count = await locator.getAttribute('data-total-count');
return count ? parseInt(count) : 0;
};
export const checkDatePicker = async (page: Page, date: Date) => {