mirror of
https://github.com/hanzo-apps/hanzo.ai.git
synced 2026-10-30 14:58:08 +00:00
_web.tsx draws rooms' App inside rooms' `Orgs`, as every room is: a reader with no organization makes one, one with several picks one, and a team on Free is asked for the Team plan before the app is drawn; a personal organization on Free opens it. The app reads its place from the path: /chat and /chat/<id> are Chat, a path under /dev is Dev. /?chat=<id> and /chat?thread=<id> move to /chat/<id>, /?at= to /dev?at=, whose place the door replaces with its path, as it does the builder's grammar rooms 0.1.35-0.1.38 wrote under /dev. The gates read the app at its paths and the rooms' shell at /home, with new Linux baselines for it; the limit banner, the model chip and the side panel are held to what rooms 0.1.55 draws; the landing's budget is 445 KB, since rooms' lib/host carries @hanzo/build's route grammar. app/gui.css is what the build writes. Co-authored-by: Hanzo Dev <[email protected]>
44 lines
2.0 KiB
TypeScript
44 lines
2.0 KiB
TypeScript
import { test, expect } from '@playwright/test'
|
|
import { serveExport } from './export'
|
|
import { signIn, answer } from '../session'
|
|
|
|
/**
|
|
* THE LOGO GOES HOME, AND YOU ARE STILL YOU WHEN YOU GET THERE.
|
|
*
|
|
* The mark at the top of the sidebar, beside the workspace switcher, is the way
|
|
* to `/`, and a way home is not a way out: the session lives in this origin's
|
|
* storage, so `/` is the app for the reader who pressed it, not the landing.
|
|
*/
|
|
test('the room logo opens the app at / and keeps the reader signed in', async ({ page }) => {
|
|
await signIn(page)
|
|
await answer(page, '/v1/agents', { agents: [] })
|
|
await answer(page, '/v1/agents/chat/conversations', { conversations: [] })
|
|
await answer(page, '/v1/agents/sessions', { sessions: [] })
|
|
await answer(page, '/v1/agent/sessions', { sessions: [] })
|
|
await answer(page, '/v1/projects', [])
|
|
await answer(page, '/v1/team/rooms', { rooms: [] })
|
|
await answer(page, '/v1/channels/inbox', { items: [] })
|
|
const site = await serveExport()
|
|
try {
|
|
await page.setViewportSize({ width: 1440, height: 900 })
|
|
await page.goto(`${site.url}/home`)
|
|
const logo = page.locator('[data-slot="workspace-switcher"] a[data-slot="home"]')
|
|
await expect(logo).toBeVisible({ timeout: 30_000 })
|
|
await expect(logo).toHaveAttribute('href', '/')
|
|
|
|
const token = () => page.evaluate(() => localStorage.getItem('hanzo_iam_access_token'))
|
|
const before = await token()
|
|
expect(before, 'the room was opened signed in').toBeTruthy()
|
|
|
|
await logo.click()
|
|
await expect(page).toHaveURL(`${site.url}/`, { timeout: 20_000 })
|
|
await expect(page.locator('main textarea').first(), 'home is the app, in Chat').toBeVisible({ timeout: 20_000 })
|
|
expect(await token(), 'the session survives the trip home').toBe(before)
|
|
// Home is the app for someone who is in: no landing's header, and no Log in.
|
|
await expect(page.locator('header[data-slot="masthead"]')).toBeHidden()
|
|
await expect(page.getByRole('button', { name: 'Log in' })).toHaveCount(0)
|
|
} finally {
|
|
await site.close()
|
|
}
|
|
})
|