@@ -5,41 +5,21 @@ import { readFileSync } from 'node:fs'
55import { resolve } from 'node:path'
66import { describe , expect , it } from 'vitest'
77
8- const auditedSurfaces = {
9- 'desktop-title-bar-page' : [
10- 'app/(auth)/components/auth-shell.tsx' ,
11- 'app/(interfaces)/resume/[workflowId]/[executionId]/loading.tsx' ,
12- 'app/(landing)/components/logo-shell/logo-shell.tsx' ,
13- 'app/desktop/auth/page.tsx' ,
14- 'app/desktop/connect/complete/page.tsx' ,
15- 'app/desktop/connect/connect-launcher.tsx' ,
16- 'app/desktop/connect/page.tsx' ,
17- 'app/f/[token]/public-file-view.tsx' ,
18- 'app/playground/page.tsx' ,
19- 'app/workspace/[workspaceId]/components/workspace-access-denied.tsx' ,
20- ] ,
21- 'desktop-title-bar-page-height' : [
22- 'app/(landing)/components/landing-shell/landing-shell.tsx' ,
23- 'app/workspace/page.tsx' ,
24- 'components/settings/settings-unavailable.tsx' ,
25- 'components/settings/standalone-settings-shell.tsx' ,
26- ] ,
27- 'desktop-title-bar-fixed-page' : [
28- 'app/(interfaces)/chat/[identifier]/chat.tsx' ,
29- 'app/(interfaces)/chat/[identifier]/loading.tsx' ,
30- 'app/(interfaces)/chat/components/loading-state/loading-state.tsx' ,
31- 'app/(interfaces)/chat/components/voice-interface/voice-interface.tsx' ,
32- 'app/workspace/[workspaceId]/components/impersonation-banner/impersonation-expired.tsx' ,
33- 'app/workspace/[workspaceId]/files/[fileId]/view/file-viewer.tsx' ,
34- ] ,
35- } as const
36-
378describe ( 'desktop title-bar surface audit' , ( ) => {
38- for ( const [ safeAreaClass , files ] of Object . entries ( auditedSurfaces ) ) {
39- for ( const file of files ) {
40- it ( `${ file } uses ${ safeAreaClass } ` , ( ) => {
41- expect ( readFileSync ( resolve ( process . cwd ( ) , file ) , 'utf8' ) ) . toContain ( safeAreaClass )
42- } )
43- }
44- }
9+ it ( 'applies the safe-area shell only when the auth route is login' , ( ) => {
10+ const authLayout = readFileSync (
11+ resolve ( process . cwd ( ) , 'app/(auth)/auth-layout-client.tsx' ) ,
12+ 'utf8'
13+ )
14+ const authShell = readFileSync (
15+ resolve ( process . cwd ( ) , 'app/(auth)/components/auth-shell.tsx' ) ,
16+ 'utf8'
17+ )
18+
19+ expect ( authLayout ) . toContain ( "usePathname() === '/login'" )
20+ expect ( authLayout ) . toContain ( 'reserveDesktopTitleBar={isLogin}' )
21+ expect ( authShell ) . toContain (
22+ "reserveDesktopTitleBar ? 'desktop-title-bar-page' : 'min-h-screen'"
23+ )
24+ } )
4525} )
0 commit comments