@@ -165,6 +165,68 @@ it.effect("reads Forgejo checks without repository or viewer requests", () => {
165165 ) ;
166166} ) ;
167167
168+ it . effect ( "opens Forgejo Actions check links on the pull request's server" , ( ) =>
169+ Effect . gen ( function * ( ) {
170+ const provider = yield * ForgejoPullRequestProvider . make ;
171+ const read = provider . getChangeRequestChecks ;
172+ if ( read === undefined ) return yield * Effect . die ( "checks read missing" ) ;
173+ const result = yield * read ( {
174+ cwd : "/repo" ,
175+ repository : "acme/web" ,
176+ host : "forgejo.test" ,
177+ number : 1 ,
178+ } ) ;
179+ assert . deepStrictEqual (
180+ result . checks . map ( ( check ) => [ check . name , check . url ] ) ,
181+ [
182+ [ "actions" , "https://forgejo.test/git/acme/web/actions/runs/7/jobs/2" ] ,
183+ [ "external" , "https://ci.example/build/9" ] ,
184+ [ "none" , null ] ,
185+ ] ,
186+ ) ;
187+ } ) . pipe (
188+ Effect . provide (
189+ Layer . mock ( ForgejoCli . ForgejoCli ) ( {
190+ api : ( input ) => {
191+ const status = ( context : string , target_url : string | null ) => ( {
192+ context,
193+ status : "success" ,
194+ description : null ,
195+ target_url,
196+ updated_at : "2026-10-11T00:00:00Z" ,
197+ } ) ;
198+ const body = input . path . endsWith ( "pulls/1" )
199+ ? {
200+ number : 1 ,
201+ title : "Checks" ,
202+ body : "" ,
203+ html_url : "https://forgejo.test/git/acme/web/pulls/1" ,
204+ user : null ,
205+ state : "open" ,
206+ merged : false ,
207+ head : { ref : "feature" , sha : "head" , repo : null } ,
208+ base : { ref : "main" , sha : "base" , repo : null } ,
209+ created_at : "2026-10-11T00:00:00Z" ,
210+ updated_at : "2026-10-11T00:00:00Z" ,
211+ closed_at : null ,
212+ merged_at : null ,
213+ labels : [ ] ,
214+ }
215+ : input . path . endsWith ( "page=1" )
216+ ? [
217+ // Forgejo includes any sub-path mount in the relative links it reports.
218+ status ( "actions" , "/git/acme/web/actions/runs/7/jobs/2" ) ,
219+ status ( "external" , "https://ci.example/build/9" ) ,
220+ status ( "none" , null ) ,
221+ ]
222+ : [ ] ;
223+ return encodeJsonEffect ( body ) . pipe ( Effect . orDie , Effect . map ( processOutput ) ) ;
224+ } ,
225+ } ) ,
226+ ) ,
227+ ) ,
228+ ) ;
229+
168230it . effect . each ( [
169231 [ "Ready" , false , true , false , "mergeable" ] ,
170232 [ "Draft" , true , false , true , "unknown" ] ,
0 commit comments