Download slate/playwright/integration/examples/select.test.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 699 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/slate/playwright/integration/examples/select.test.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/slate/playwright/integration/examples/select.test.ts
-
curl -L -o select.test.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/slate/playwright/integration/examples/select.test.ts
699 Bytes
| import { test, expect } from '@playwright/test' | |
| test.describe('selection', () => { | |
| const slateEditor = '[data-slate-node="element"]' | |
| test.beforeEach( | |
| async ({ page }) => | |
| await page.goto('http://localhost:3000/examples/richtext') | |
| ) | |
| test('select the correct block when triple clicking', async ({ page }) => { | |
| // triple clicking the second block (paragraph) shouldn't highlight the | |
| // quote button | |
| for (let i = 0; i < 3; i++) { | |
| await page.locator(slateEditor).nth(1).click() | |
| } | |
| await page.pause() | |
| // .css-1vdn1ty is the gray, unselected button | |
| expect(await page.locator('.css-1vdn1ty').nth(6).textContent()).toBe( | |
| 'format_quote' | |
| ) | |
| }) | |
| }) | |