Download slate/playwright/integration/examples/mentions.test.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.17 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/slate/playwright/integration/examples/mentions.test.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/slate/playwright/integration/examples/mentions.test.ts
-
curl -L -o mentions.test.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/slate/playwright/integration/examples/mentions.test.ts
1.17 kB
| import { test, expect } from '@playwright/test' | |
| test.describe('mentions example', () => { | |
| test.beforeEach( | |
| async ({ page }) => | |
| await page.goto('http://localhost:3000/examples/mentions') | |
| ) | |
| test('renders mention element', async ({ page }) => { | |
| await expect(page.locator('[data-cy="mention-R2-D2"]')).toHaveCount(1) | |
| await expect(page.locator('[data-cy="mention-Mace-Windu"]')).toHaveCount(1) | |
| }) | |
| test('shows list of mentions', async ({ page }) => { | |
| await page.getByRole('textbox').click() | |
| await page.getByRole('textbox').selectText() | |
| await page.getByRole('textbox').press('Backspace') | |
| await page.getByRole('textbox').pressSequentially(' @ma') | |
| await expect(page.locator('[data-cy="mentions-portal"]')).toHaveCount(1) | |
| }) | |
| test('inserts on enter from list', async ({ page }) => { | |
| await page.getByRole('textbox').click() | |
| await page.getByRole('textbox').selectText() | |
| await page.getByRole('textbox').press('Backspace') | |
| await page.getByRole('textbox').pressSequentially(' @Ja') | |
| await page.getByRole('textbox').press('Enter') | |
| await expect(page.locator('[data-cy="mention-Jabba"]')).toHaveCount(1) | |
| }) | |
| }) | |