mirror of
https://github.com/hanzo-apps/hanzo.ai.git
synced 2026-10-29 07:20:43 +00:00
The gates answered hanzo.id only, so once serverUrl moved to api.hanzo.ai discovery and the address lookup went unanswered and 22 of them failed. e2e/gates/issuer.ts now answers discovery, the token, userinfo, the lookup and the methods on api.hanzo.ai, records the authorize page on hanzo.id, and answers this origin's credential routes. login, silent, signin, follow, apex, guest, cards, forward, host, orgs, own, affiliate, signin-header and signIn use it in place of their own copies. contract() is the rule: hanzo.id is the authorize page, and is asked nothing but the account row and appearance @hanzo/rooms still addresses there. Claude-Session: https://claude.ai/code/session_01HvACxex9ZZTzJCCHgirsGy
41 lines
2.0 KiB
TypeScript
41 lines
2.0 KiB
TypeScript
import { test, expect } from '@playwright/test'
|
|
import { serveExport } from './export'
|
|
import { asked, issuer } from './issuer'
|
|
|
|
/**
|
|
* A ROOM REQUIRES A SESSION, AND THE ASK IS FOR THE WHOLE PLACE.
|
|
*
|
|
* Home's cards each carried an ask of their own — "Sign in to see your
|
|
* projects", and the same for apps and for the team — because the room was
|
|
* drawn for a stranger and only its contents were withheld. The organization
|
|
* gate stands in front of every room now, so a visitor without a session never
|
|
* reaches a card: one ask for the place, rather than one per panel.
|
|
*
|
|
* THE ABSENCE IS HALF THE SUBJECT. An ask on screen reads the same over a room
|
|
* drawn underneath it, which is the state this exists to remove, so the room's
|
|
* own chrome is measured too and it must not be there.
|
|
*/
|
|
test('signed out, the gate asks for a session and no room is drawn', async ({ page }) => {
|
|
const site = await serveExport()
|
|
try {
|
|
const seen = await issuer(page)
|
|
await page.setViewportSize({ width: 1440, height: 900 })
|
|
await page.goto(`${site.url}/home`)
|
|
|
|
// The ask is this site's sign-in, in this tab (a stranger's is sign-up), and
|
|
// the room is where it returns.
|
|
await page.waitForURL((u) => u.pathname === '/signup', { timeout: 20_000 })
|
|
expect(new URL(page.url()).searchParams.get('next'), 'the room rides along in the address').toBe('/home')
|
|
await expect(page.getByRole('region', { name: /^(Log in|Sign up)$/ }).getByLabel('Email')).toBeVisible({ timeout: 20_000 })
|
|
expect(await page.evaluate(() => sessionStorage.getItem('signin.destination'))).toBe('/home')
|
|
|
|
// Not behind it, not under it, not anywhere: the room is not mounted.
|
|
await expect(page.locator('[data-room]')).toHaveCount(0)
|
|
await expect(page.locator('[data-slot="sidebar"]')).toHaveCount(0)
|
|
await expect(page.locator('[data-slot="composer"]')).toHaveCount(0)
|
|
expect(asked(seen), 'nobody is sent to hanzo.id to type a password').toEqual([])
|
|
} finally {
|
|
await site.close()
|
|
}
|
|
})
|