@@ -1086,6 +1086,112 @@ describe('GET /admin/ (dashboard)', () => {
10861086 vi . restoreAllMocks ( ) ;
10871087 } ) ;
10881088
1089+ test ( 'keeps deployment columns readable and long errors compact across list views' , async ( ) => {
1090+ const admin = await createTestUser (
1091+ env . db ,
1092+ 'deployment-layout-admin' ,
1093+ 'github' ,
1094+ undefined ,
1095+ 'free' ,
1096+ 'admin' ,
1097+ ) ;
1098+ const project = await createTestProject (
1099+ env . db ,
1100+ admin . id ,
1101+ 'a-project-with-a-long-name-for-truncation' ,
1102+ ) ;
1103+ const error = 'Worker upload failed: upstream rejected the deployment.\n' . repeat ( 20 ) ;
1104+ const failed = await createTestDeployment ( env . db , project . id , 'failed' , 'cli' , error ) ;
1105+ const client = await readFile (
1106+ new URL ( '../../dist/admin-assets/admin/client.js' , import . meta. url ) ,
1107+ ) ;
1108+ const css = await readFile ( new URL ( '../../dist/admin-assets/admin/style.css' , import . meta. url ) ) ;
1109+ const browser = await chromium . launch ( ) ;
1110+ try {
1111+ for ( const width of [ 1280 , 390 ] ) {
1112+ const context = await browser . newContext ( { viewport : { width, height : 844 } } ) ;
1113+ await context . addCookies ( [
1114+ { name : 'admin_token' , value : admin . adminJwt , url : 'http://localhost' } ,
1115+ ] ) ;
1116+ await context . addInitScript ( ( ) => {
1117+ Object . defineProperty ( navigator , 'clipboard' , {
1118+ value : {
1119+ writeText : async ( text : string ) => {
1120+ ( window as unknown as { copiedError : string } ) . copiedError = text ;
1121+ } ,
1122+ } ,
1123+ } ) ;
1124+ } ) ;
1125+ const page = await context . newPage ( ) ;
1126+ const errors : Array < string > = [ ] ;
1127+ page . on ( 'pageerror' , ( error ) => errors . push ( error . message ) ) ;
1128+ await page . route ( '**/*' , async ( route ) => {
1129+ const incoming = route . request ( ) ;
1130+ const url = new URL ( incoming . url ( ) ) ;
1131+ if ( url . origin !== 'http://localhost' ) {
1132+ return route . abort ( ) ;
1133+ }
1134+ if ( url . pathname === '/admin/client.js' || url . pathname === '/admin/style.css' ) {
1135+ return route . fulfill ( {
1136+ contentType : url . pathname . endsWith ( '.js' ) ? 'text/javascript' : 'text/css' ,
1137+ body : url . pathname . endsWith ( '.js' ) ? client : css ,
1138+ } ) ;
1139+ }
1140+ const response = await app . fetch (
1141+ new Request ( incoming . url ( ) , {
1142+ method : incoming . method ( ) ,
1143+ headers : await incoming . allHeaders ( ) ,
1144+ ...( incoming . method ( ) === 'POST' ? { body : incoming . postData ( ) ?? '' } : { } ) ,
1145+ } ) ,
1146+ { ...env , DEV_AUTH_BYPASS : 'true' } ,
1147+ ) ;
1148+ await route . fulfill ( {
1149+ status : response . status ,
1150+ headers : Object . fromEntries ( response . headers ) ,
1151+ body : Buffer . from ( await response . arrayBuffer ( ) ) ,
1152+ } ) ;
1153+ } ) ;
1154+ for ( const path of [ '/admin/' , '/admin/deployments' , `/admin/projects/${ project . id } ` ] ) {
1155+ await page . goto ( `http://localhost${ path } ` ) ;
1156+ await page . locator ( '[data-hydrated="true"]' ) . waitFor ( ) ;
1157+ const table = page . locator ( '.void-admin-deployments-table' ) ;
1158+ const row = table
1159+ . getByRole ( 'row' )
1160+ . filter ( { has : page . getByRole ( 'link' , { name : failed . id , exact : true } ) } ) ;
1161+ expect ( ( await row . boundingBox ( ) ) ! . height ) . toBeLessThan ( 55 ) ;
1162+ const columns = await table . locator ( 'th' ) . evaluateAll ( ( headers ) =>
1163+ headers . map ( ( header ) => ( {
1164+ title : header . textContent ,
1165+ width : header . getBoundingClientRect ( ) . width ,
1166+ } ) ) ,
1167+ ) ;
1168+ expect ( columns . find ( ( column ) => column . title === 'Created' ) ! . width ) . toBeLessThan (
1169+ ( await table . boundingBox ( ) ) ! . width / 3 ,
1170+ ) ;
1171+ expect ( columns . every ( ( column ) => column . width >= 64 ) ) . toBe ( true ) ;
1172+ const message = row . locator ( '.void-admin-deployment-error-message' ) ;
1173+ expect ( await message . textContent ( ) ) . toBe ( error ) ;
1174+ expect ( ( await message . boundingBox ( ) ) ! . height ) . toBeLessThan ( 30 ) ;
1175+ await message . hover ( ) ;
1176+ await page . getByRole ( 'tooltip' ) . filter ( { hasText : 'Worker upload failed' } ) . waitFor ( ) ;
1177+ await row . getByRole ( 'button' , { name : 'Copy' , exact : true } ) . click ( ) ;
1178+ await expect
1179+ . poll ( ( ) =>
1180+ page . evaluate ( ( ) => ( window as unknown as { copiedError ?: string } ) . copiedError ) ,
1181+ )
1182+ . toBe ( error ) ;
1183+ expect (
1184+ await page . evaluate ( ( ) => document . documentElement . scrollWidth <= window . innerWidth ) ,
1185+ ) . toBe ( true ) ;
1186+ }
1187+ expect ( errors ) . toEqual ( [ ] ) ;
1188+ await context . close ( ) ;
1189+ }
1190+ } finally {
1191+ await browser . close ( ) ;
1192+ }
1193+ } , 30_000 ) ;
1194+
10891195 test ( 'does not query Analytics Engine during the initial dashboard render' , async ( ) => {
10901196 const admin = await createTestUser (
10911197 env . db ,
0 commit comments