13 lines
588 B
TypeScript
13 lines
588 B
TypeScript
import { expect, test } from '@playwright/test'
|
|
|
|
test('serves the application icon for the browser tab', async ({ page }) => {
|
|
await page.goto('/')
|
|
const icon = page.locator('link[rel="icon"]')
|
|
await expect(icon).toHaveAttribute('href', '/app-logo.png')
|
|
await expect(icon).toHaveAttribute('type', 'image/png')
|
|
const response = await page.request.get('/app-logo.png')
|
|
expect(response.ok()).toBe(true)
|
|
expect(response.headers()['content-type']).toContain('image/png')
|
|
expect((await response.body()).subarray(0, 8)).toEqual(Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]))
|
|
})
|