test: add some tests for page filter (#2593)

This commit is contained in:
3720
2023-05-30 16:39:14 +08:00
committed by GitHub
parent 395414c336
commit 8c5a1e2de3
9 changed files with 221 additions and 105 deletions

View File

@@ -5,7 +5,7 @@ import type {
View,
} from '@affine/component/page-list';
import {
filterByView,
filterByFilterList,
PageList,
PageListTrashView,
} from '@affine/component/page-list';
@@ -92,10 +92,10 @@ export const BlockSuitePageList: React.FC<BlockSuitePageListProps> = ({
if (!view) {
return true;
}
return filterByView(view, {
return filterByFilterList(view.filterList, {
Favorite: !!pageMeta.favorite,
Created: pageMeta.createDate,
Updated: pageMeta.updatedDate,
Updated: pageMeta.updatedDate ?? pageMeta.createDate,
});
}),
[pageMetas, listType, view]