@@ -5,6 +5,7 @@ import * as Layer from "effect/Layer";
55import * as Redacted from "effect/Redacted" ;
66import * as Schema from "effect/Schema" ;
77import { HttpClient , HttpClientResponse } from "effect/http" ;
8+ import { IssueTemplateList } from "@t3tools/contracts" ;
89import * as GitHubCredentials from "./GitHubCredentials.ts" ;
910import * as GitHubRest from "./GitHubRest.ts" ;
1011import * as GitHubQuota from "./GitHubQuota.ts" ;
@@ -28,7 +29,7 @@ const DETAIL_RESPONSE = JSON.stringify({
2829 name : "Octo Cat" ,
2930 } ,
3031 state : "CLOSED" ,
31- stateReason : "NOT_PLANNED " ,
32+ stateReason : "DUPLICATE " ,
3233 createdAt : "2026-07-01T00:00:00Z" ,
3334 updatedAt : "2026-07-03T00:00:00Z" ,
3435 closedAt : "2026-07-03T00:00:00Z" ,
@@ -199,6 +200,8 @@ function tracker(onRequest: (variables: unknown) => void, templateRepository?: u
199200 ) ;
200201}
201202
203+ const encodeTemplateList = Schema . encodeSync ( IssueTemplateList ) ;
204+
202205const decodeBody = Schema . decodeUnknownSync (
203206 Schema . fromJsonString ( Schema . Record ( Schema . String , Schema . Unknown ) ) ,
204207) ;
@@ -376,6 +379,14 @@ body:
376379 entries : [
377380 { name : "config.yml" , object : config } ,
378381 { name : "bug_report.yml" , object : form } ,
382+ {
383+ name : "empty_name.yml" ,
384+ object : { ...form , text : 'name: ""\ndescription: Empty name\nbody: []' } ,
385+ } ,
386+ {
387+ name : "blank_name.yml" ,
388+ object : { ...form , text : 'name: " "\ndescription: Blank name\nbody: []' } ,
389+ } ,
379390 {
380391 name : "invalid.yml" ,
381392 object : { ...form , text : "name: Missing required metadata\nbody: []" } ,
@@ -386,6 +397,7 @@ body:
386397 const api = yield * tracker ( ( ) => { } , repository ) ;
387398 const input = { cwd : "/w" , host : "github.com" , scope : "acme/web" } ;
388399 const result = yield * api . listTemplates ! ( input ) ;
400+ expect ( encodeTemplateList ( result ) ) . toEqual ( result ) ;
389401 expect ( result . blankIssuesEnabled ) . toBe ( false ) ;
390402 expect ( result . templates ) . toHaveLength ( 1 ) ;
391403 expect ( result . templates [ 0 ] ) . toMatchObject ( {
@@ -460,7 +472,7 @@ Redact secrets before uploading.`);
460472 displayKey : "#42" ,
461473 title : "Composer loses focus" ,
462474 body : "Typing in the composer drops focus after a paste." ,
463- state : { category : "closed" , name : "closed" , closeReason : "not-planned " } ,
475+ state : { category : "closed" , name : "closed" , closeReason : "duplicate " } ,
464476 author : {
465477 login : "octocat" ,
466478 name : "Octo Cat" ,
0 commit comments