mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 12:55:00 +00:00
refactor(component): virtual rendering page list (#4775)
Co-authored-by: Joooye_34 <Joooye1991@gmail.com>
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user