@@ -99,8 +99,8 @@ describe("notification pipeline", () => {
9999 ) . resolves . toBeNull ( ) ;
100100 } ) ;
101101
102- it ( "renders cron failures with the service deep link " , async ( ) => {
103- mocks . select . mockReturnValueOnce ( {
102+ it ( "omits raw build and cron errors from in-app notifications " , async ( ) => {
103+ mocks . select . mockReturnValue ( {
104104 from : vi . fn ( ( ) => ( {
105105 innerJoin : vi . fn ( ( ) => ( {
106106 innerJoin : vi . fn ( ( ) => ( {
@@ -119,6 +119,19 @@ describe("notification pipeline", () => {
119119 } ) ) ,
120120 } ) ;
121121
122+ await expect (
123+ renderInAppNotification ( {
124+ kind : "build.failed" ,
125+ occurrenceId : "build-1" ,
126+ serviceId : "service-1" ,
127+ buildId : "build-1" ,
128+ error : "buildctl failed\n" . repeat ( 1_000 ) ,
129+ } ) ,
130+ ) . resolves . toEqual ( {
131+ title : "Build failed: API" ,
132+ body : "A build for API failed." ,
133+ href : "/dashboard/projects/cloud/production/services/service-1/builds/build-1" ,
134+ } ) ;
122135 await expect (
123136 renderInAppNotification ( {
124137 kind : "cron.failed" ,
@@ -130,7 +143,21 @@ describe("notification pipeline", () => {
130143 } ) ,
131144 ) . resolves . toEqual ( {
132145 title : "Cron failed: API" ,
133- body : "/jobs/nightly: HTTP status 500" ,
146+ body : "/jobs/nightly failed with HTTP status 500." ,
147+ href : "/dashboard/projects/cloud/production/services/service-1" ,
148+ } ) ;
149+ await expect (
150+ renderInAppNotification ( {
151+ kind : "cron.failed" ,
152+ occurrenceId : "cron-2" ,
153+ serviceId : "service-1" ,
154+ path : "/jobs/nightly" ,
155+ statusCode : null ,
156+ error : "Connection refused" ,
157+ } ) ,
158+ ) . resolves . toEqual ( {
159+ title : "Cron failed: API" ,
160+ body : "/jobs/nightly failed." ,
134161 href : "/dashboard/projects/cloud/production/services/service-1" ,
135162 } ) ;
136163 } ) ;
0 commit comments