24 lines
793 B
JavaScript
24 lines
793 B
JavaScript
|
|
import { test, expect } from '@playwright/test'
|
||
|
|
|
||
|
|
test('page loads with correct title', async ({ page }) => {
|
||
|
|
await page.goto('/')
|
||
|
|
await expect(page.locator('h1')).toHaveText('ASCIInator')
|
||
|
|
})
|
||
|
|
|
||
|
|
test('drop zone is visible', async ({ page }) => {
|
||
|
|
await page.goto('/')
|
||
|
|
await expect(page.getByText('Drop, paste (Ctrl+V), or click to upload')).toBeVisible()
|
||
|
|
})
|
||
|
|
|
||
|
|
test('four tool buttons are rendered', async ({ page }) => {
|
||
|
|
await page.goto('/')
|
||
|
|
for (const label of ['chafa', 'jp2a', 'ascii-image-converter', 'img2txt']) {
|
||
|
|
await expect(page.getByRole('button', { name: label })).toBeVisible()
|
||
|
|
}
|
||
|
|
})
|
||
|
|
|
||
|
|
test('convert button is disabled until an image is loaded', async ({ page }) => {
|
||
|
|
await page.goto('/')
|
||
|
|
await expect(page.getByRole('button', { name: 'Convert' })).toBeDisabled()
|
||
|
|
})
|