@@ -50,10 +50,9 @@ describe("availablePrompts", () => {
5050
5151 it ( "should include feature-specific prompts when activeFeatures is provided" , async ( ) => {
5252 const prompts = await availablePrompts ( mockContext , [ "crashlytics" ] ) ;
53- const crashPrompt = prompts . find ( ( p ) => p . mcp . _meta ?. feature === "crashlytics" ) ;
5453
55- // Should exist because we bypass availability check
56- expect ( crashPrompt ) . to . exist ;
54+ const features = [ ... new Set ( prompts . map ( ( p ) => p . mcp . _meta ?. feature ) ) ] ;
55+ expect ( features ) . to . have . members ( [ "core" , "crashlytics" ] ) ;
5756
5857 // getDefaultFeatureAvailabilityCheck execution is deferred/lazy-loaded in prompt.ts
5958 // Since activeFeatures bypasses checking .isAvailable on the prompt, the stub should NOT be called.
@@ -71,9 +70,8 @@ describe("availablePrompts", () => {
7170 getDefaultFeatureAvailabilityCheckStub . withArgs ( "crashlytics" ) . returns ( async ( ) => true ) ;
7271
7372 const prompts = await availablePrompts ( mockContext , [ ] , [ "crashlytics" ] ) ;
74- const crashPrompt = prompts . find ( ( p ) => p . mcp . _meta ?. feature === "crashlytics" ) ;
75-
76- expect ( crashPrompt ) . to . exist ;
73+ const features = [ ...new Set ( prompts . map ( ( p ) => p . mcp . _meta ?. feature ) ) ] ;
74+ expect ( features ) . to . have . members ( [ "core" , "crashlytics" ] ) ;
7775
7876 // Fallback logic calls isAvailable(), which invokes our lazy check, calling getDefault...
7977 expect ( getDefaultFeatureAvailabilityCheckStub . called ) . to . be . true ;
0 commit comments