Skip to content

Commit

Permalink
chore: add more test for Large Dataset example (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding authored Nov 9, 2023
1 parent 5e58ceb commit 5ea0fad
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions playwright/e2e/example10.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,20 @@ test.describe('Example 10 - Large Select Dataset with Virtual Scroll', () => {
await page.locator('label').filter({ hasText: '9998' }).click();
await page.locator('label').filter({ hasText: '9999' }).click();
await page.getByRole('button', { name: '0, 1, 5001' }).click();

// clear filter, scroll back to top and expect 0,1 to still be checked
await page.locator('[data-test="select10"].ms-parent').click();
await page.locator('[data-test="select10"] .ms-search .icon-close').click();
await ulElm.evaluate((e) => (e.scrollTop = 0));
await expect(liElms.nth(0)).toContainText('0');
await expect(liElms.nth(1)).toContainText('1');
expect(await liElms.nth(0).locator('input[type=checkbox][data-key=option_0]').isChecked()).toBeTruthy();
expect(await liElms.nth(1).locator('input[type=checkbox][data-key=option_1]').isChecked()).toBeTruthy();
expect(await liElms.nth(2).locator('input[type=checkbox][data-key=option_2]').isChecked()).toBeFalsy();

// scroll back to middle and expect 5001 to still be checked
await ulElm.evaluate((e) => (e.scrollTop = e.scrollHeight / 2));
expect(await page.locator('label').filter({ hasText: '5001' })).toBeVisible();
expect(await liElms.locator('input[type=checkbox][data-key=option_5001]').isChecked()).toBeTruthy();
});
});

0 comments on commit 5ea0fad

Please sign in to comment.