|
1 | 1 | import { expect, test } from '@playwright/test'; |
2 | | -import { openPanel, gotoPage } from './utils'; |
| 2 | +import { openPanel, gotoPage, clickGridRow } from './utils'; |
3 | 3 |
|
4 | 4 | const REACT_PANEL_VISIBLE = '.dh-react-panel:visible'; |
5 | 5 |
|
@@ -40,3 +40,21 @@ test('UI table responds to prop changes', async ({ page }) => { |
40 | 40 | await locator.getByRole('button', { name: 'case' }).click(); |
41 | 41 | await expect(locator).toHaveScreenshot(); |
42 | 42 | }); |
| 43 | + |
| 44 | +test('UI table on_selection_change', async ({ page }) => { |
| 45 | + await gotoPage(page, ''); |
| 46 | + await openPanel(page, 't_selection', REACT_PANEL_VISIBLE); |
| 47 | + |
| 48 | + const locator = page.locator(REACT_PANEL_VISIBLE); |
| 49 | + |
| 50 | + await clickGridRow(locator, 3); |
| 51 | + await expect(page.getByText("Selection: [['CAT', 'NYPE']]")).toBeVisible(); |
| 52 | + |
| 53 | + await clickGridRow(locator, 0, { modifiers: ['ControlOrMeta'] }); |
| 54 | + await expect( |
| 55 | + page.getByText("Selection: [['FISH', 'TPET'], ['CAT', 'NYPE']]") |
| 56 | + ).toBeVisible(); |
| 57 | + |
| 58 | + await page.keyboard.press('Escape'); |
| 59 | + await expect(page.getByText('Selection: []')).toBeVisible(); |
| 60 | +}); |
0 commit comments