Download slate/playwright/integration/examples/richtext.test.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 717 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/slate/playwright/integration/examples/richtext.test.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/slate/playwright/integration/examples/richtext.test.ts
-
curl -L -o richtext.test.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/slate/playwright/integration/examples/richtext.test.ts
717 Bytes
| import { test, expect } from '@playwright/test' | |
| test.describe('On richtext example', () => { | |
| test.beforeEach( | |
| async ({ page }) => | |
| await page.goto('http://localhost:3000/examples/richtext') | |
| ) | |
| test('renders rich text', async ({ page }) => { | |
| expect(await page.locator('strong').nth(0).textContent()).toContain('rich') | |
| expect(await page.locator('blockquote').textContent()).toContain( | |
| 'wise quote' | |
| ) | |
| }) | |
| test('inserts text when typed', async ({ page }) => { | |
| await page.getByRole('textbox').press('Home') | |
| await page.getByRole('textbox').pressSequentially('Hello World') | |
| expect(await page.getByRole('textbox').textContent()).toContain( | |
| 'Hello World' | |
| ) | |
| }) | |
| }) | |