Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add more tests for Large Dataset example #155

Merged
merged 1 commit into from
Nov 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
});
});