mirror of
https://github.com/hanzo-apps/hanzo.ai.git
synced 2026-10-29 07:20:43 +00:00
scripts/edge.mjs renders the retired model pages against out/ (lib/moved), and the unit project runs with no export, so the render test failed there (CI/CD 38783081783). It moves beside the edge rules in e2e/gates/edge.spec.ts; the frame headers' own test stays a unit.
18 lines
1.0 KiB
TypeScript
18 lines
1.0 KiB
TypeScript
import { test, expect } from '@playwright/test'
|
|
import { FRAME, framed } from '../../lib/edge'
|
|
|
|
/**
|
|
* NO PAGE FRAMES A SIGN-IN PAGE. The site's content policy is report-only, so
|
|
* the edge sends `X-Frame-Options: DENY` and an enforced
|
|
* `Content-Security-Policy: frame-ancestors 'none'` with /login, /signup,
|
|
* /forget, /join and everything under /auth/ (lib/edge.ts `FRAME`), rendered into
|
|
* universe by scripts/edge.mjs — whose render is held by e2e/gates/edge.spec.ts,
|
|
* since it reads the export's own model pages.
|
|
*/
|
|
|
|
test('the sign-in pages are framed by nothing, and only they carry the headers', () => {
|
|
for (const path of ['/login', '/login/x', '/signup', '/forget', '/join', '/auth/callback', '/auth/initiate']) expect(framed(path), path).toBe(true)
|
|
for (const path of ['/', '/pricing', '/loginx', '/joiner', '/forgetful', '/authz', '/account']) expect(framed(path), path).toBe(false)
|
|
expect(FRAME.headers).toEqual({ 'X-Frame-Options': 'DENY', 'Content-Security-Policy': "frame-ancestors 'none'" })
|
|
})
|