Files
hanzo.ai/e2e/gates/lane.spec.ts
zeekay 6f25d7cc46 The chat composer has no footer.
A free model's terms stay the one said at onboarding.
2026-10-21 02:52:40 -07:00

59 lines
2.3 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { test, expect, type Page } from '@playwright/test'
import { serveExport } from './export'
import { signIn, answer } from '../session'
/**
* THE COMPOSER HAS NO LEGAL FOOT.
*
* A free model's data-share choice is made once, at onboarding. Chat does not
* repeat it under the composer, on the free lane or the paid one. Both
* directions are asserted, because a line that renders on only one of them
* would still be a footer.
*/
const FREE = { data: [{ id: 'free' }] }
const PAID = { data: [{ id: 'qwen3-coder' }] }
const room = (page: Page) => page.locator('main')
test('a signed-in reader on the free lane sees the room and no note under the composer', async ({ page }) => {
await signIn(page)
await answer(page, '/v1/models', FREE)
const site = await serveExport()
try {
await page.setViewportSize({ width: 1440, height: 900 })
await page.goto(`${site.url}/chat`)
const main = room(page)
await expect(main).toContainText(/What can I help with\?|What’s up/, { timeout: 20_000 })
const said = await main.innerText()
expect(said, 'no free-lane footer').not.toContain('Free chat is data-shared')
expect(said, 'no caution over the composer').not.toContain('can make mistakes')
expect(said, 'no banner over the room').not.toContain('may be used to improve models')
await expect(main.getByRole('link', { name: 'Privacy' })).toHaveCount(0)
await expect(main.getByRole('link', { name: 'Terms' })).toHaveCount(0)
} finally {
await site.close()
}
})
test('a paid route has the same empty foot', async ({ page }) => {
await signIn(page)
await answer(page, '/v1/models', PAID)
const site = await serveExport()
try {
await page.setViewportSize({ width: 1440, height: 900 })
await page.goto(`${site.url}/chat`)
// Wait for the room before reading its absence, or this passes on an empty
// page — the failure every "must not contain" assertion invites.
const main = room(page)
await expect(main).toContainText(/What can I help with\?|What’s up/, { timeout: 20_000 })
expect(await main.innerText(), 'a paid route claims its messages are shared').not.toContain(
'Free chat is data-shared',
)
await expect(main.getByRole('link', { name: 'Terms' })).toHaveCount(0)
await expect(main.getByRole('link', { name: 'Privacy' })).toHaveCount(0)
} finally {
await site.close()
}
})