@@ -128,19 +128,6 @@ describe("hooks cli formatting", () => {
128128 expect ( output ) . not . toContain ( "Internal Hooks" ) ;
129129 } ) ;
130130
131- it ( "labels hooks status output" , ( ) => {
132- const output = formatHooksCheck ( report , { } ) ;
133- expect ( output ) . toContain ( "Hooks Status" ) ;
134- } ) ;
135-
136- it ( "classifies eventless hooks as not ready in human check output" , ( ) => {
137- const output = formatHooksCheck ( createEventlessHookReport ( ) , { } ) ;
138-
139- expect ( output ) . toContain ( "Ready: 0" ) ;
140- expect ( output ) . toContain ( "Not ready: 1" ) ;
141- expect ( output ) . toContain ( "session-memory - no events defined" ) ;
142- } ) ;
143-
144131 it ( "shows eventless hooks as blocked by their event declaration in list output" , ( ) => {
145132 const output = formatHooksList ( createEventlessHookReport ( ) , { } ) ;
146133
@@ -156,6 +143,30 @@ describe("hooks cli formatting", () => {
156143 expect ( output ) . not . toContain ( "missing requirements" ) ;
157144 } ) ;
158145
146+ it . each ( [
147+ [ "disabled in config" , "disabled in config" ] ,
148+ [ "workspace hook (disabled by default)" , "workspace hook" ] ,
149+ ] as const ) (
150+ "does not report disabled hook policy as a missing requirement: %s" ,
151+ ( blockedReason , displayedPolicyReason ) => {
152+ const disabledReport : HookStatusReport = {
153+ ...report ,
154+ hooks : [
155+ {
156+ ...expectDefined ( report . hooks [ 0 ] , "report.hooks[0] test invariant" ) ,
157+ enabledByConfig : false ,
158+ loadable : false ,
159+ blockedReason,
160+ } ,
161+ ] ,
162+ } ;
163+ const output = formatHooksList ( disabledReport , { verbose : true } ) ;
164+
165+ expect ( output ) . toContain ( "disabled" ) ;
166+ expect ( output ) . not . toContain ( displayedPolicyReason ) ;
167+ } ,
168+ ) ;
169+
159170 it ( "shows eventless hooks as blocked by their event declaration in info output" , ( ) => {
160171 const output = formatHookInfo ( createEventlessHookReport ( ) , "session-memory" , { } ) ;
161172
@@ -171,6 +182,19 @@ describe("hooks cli formatting", () => {
171182 expect ( output ) . toContain ( "DEMO_HOOK_TOKEN" ) ;
172183 } ) ;
173184
185+ it ( "labels hooks status output" , ( ) => {
186+ const output = formatHooksCheck ( report , { } ) ;
187+ expect ( output ) . toContain ( "Hooks Status" ) ;
188+ } ) ;
189+
190+ it ( "classifies eventless hooks as not ready in human check output" , ( ) => {
191+ const output = formatHooksCheck ( createEventlessHookReport ( ) , { } ) ;
192+
193+ expect ( output ) . toContain ( "Ready: 0" ) ;
194+ expect ( output ) . toContain ( "Not ready: 1" ) ;
195+ expect ( output ) . toContain ( "session-memory - no events defined" ) ;
196+ } ) ;
197+
174198 it ( "classifies eventless hooks as not eligible in JSON check output" , ( ) => {
175199 const output = JSON . parse ( formatHooksCheck ( createEventlessHookReport ( ) , { json : true } ) ) ;
176200
0 commit comments