feat(tree): add flat and lazy modes for tree data handling
* Implement flat mode to transform flat data with parentId to nested structure. * Introduce lazy mode for on-demand loading of children. * Update tree rendering logic to accommodate new modes. * Enhance tree cell expansion logic to support lazy loading. * Add dark mode styles for improved UI experience. * Create comprehensive end-to-end tests for tree functionality.
This commit is contained in:
@@ -211,11 +211,14 @@ test.describe('Tree with Search Auto-Expand', () => {
|
||||
});
|
||||
|
||||
test('Ctrl+F opens search overlay', async ({ page }) => {
|
||||
// Focus the grid scroll container before pressing keyboard shortcut
|
||||
await page.locator('[role="grid"] [tabindex="0"]').click();
|
||||
await page.keyboard.press('Control+f');
|
||||
await expect(page.locator('[aria-label="Search grid"]')).toBeVisible({ timeout: 3000 });
|
||||
});
|
||||
|
||||
test('searching for a leaf node auto-expands ancestors', async ({ page }) => {
|
||||
await page.locator('[role="grid"] [tabindex="0"]').click();
|
||||
await page.keyboard.press('Control+f');
|
||||
const searchInput = page.locator('[aria-label="Search grid"]');
|
||||
await searchInput.fill('Alice');
|
||||
@@ -230,6 +233,7 @@ test.describe('Tree with Search Auto-Expand', () => {
|
||||
});
|
||||
|
||||
test('clearing search preserves expanded state', async ({ page }) => {
|
||||
await page.locator('[role="grid"] [tabindex="0"]').click();
|
||||
await page.keyboard.press('Control+f');
|
||||
const searchInput = page.locator('[aria-label="Search grid"]');
|
||||
await searchInput.fill('Alice');
|
||||
|
||||
Reference in New Issue
Block a user