Download slate/playwright/integration/examples/read-only.test.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 600 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/slate/playwright/integration/examples/read-only.test.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/slate/playwright/integration/examples/read-only.test.ts
-
curl -L -o read-only.test.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/slate/playwright/integration/examples/read-only.test.ts
600 Bytes
| import { test, expect } from '@playwright/test' | |
| test.describe('readonly editor', () => { | |
| test.beforeEach(async ({ page }) => { | |
| await page.goto('http://localhost:3000/examples/read-only') | |
| }) | |
| test('should not be editable', async ({ page }) => { | |
| const slateEditor = '[data-slate-editor="true"]' | |
| expect( | |
| await page.locator(slateEditor).getAttribute('contentEditable') | |
| ).toBe('false') | |
| expect(await page.locator(slateEditor).getAttribute('role')).toBe(null) | |
| await page.locator(slateEditor).click() | |
| await expect(page.locator(slateEditor)).not.toBeFocused() | |
| }) | |
| }) | |