@@ -13,8 +13,8 @@ describe("GhostStrategy", () => {
1313 strategy = new GhostStrategy ( )
1414 } )
1515
16- describe ( "getSystemPrompt " , ( ) => {
17- it ( "should use PromptStrategyManager to generate system prompt " , ( ) => {
16+ describe ( "getPrompts " , ( ) => {
17+ it ( "should use PromptStrategyManager to generate prompts " , ( ) => {
1818 const mockDocument = {
1919 languageId : "typescript" ,
2020 getText : ( ) => "const x = 1;" ,
@@ -27,10 +27,10 @@ describe("GhostStrategy", () => {
2727 userInput : "Complete this function" ,
2828 }
2929
30- const prompt = strategy . getSystemPrompt ( context )
30+ const { systemPrompt } = strategy . getPrompts ( context )
3131
3232 // Should contain base instructions from strategy system
33- expect ( prompt ) . toContain ( "CRITICAL OUTPUT FORMAT" )
33+ expect ( systemPrompt ) . toContain ( "CRITICAL OUTPUT FORMAT" )
3434 } )
3535
3636 it ( "should select UserRequestStrategy when user input is provided" , ( ) => {
@@ -47,8 +47,7 @@ describe("GhostStrategy", () => {
4747 userInput : "Add a function to calculate sum" ,
4848 }
4949
50- const systemPrompt = strategy . getSystemPrompt ( context )
51- const userPrompt = strategy . getSuggestionPrompt ( context )
50+ const { systemPrompt, userPrompt } = strategy . getPrompts ( context )
5251
5352 // UserRequestStrategy should be selected
5453 expect ( systemPrompt ) . toContain ( "Execute User's Explicit Request" )
@@ -80,35 +79,13 @@ describe("GhostStrategy", () => {
8079 ] ,
8180 }
8281
83- const systemPrompt = strategy . getSystemPrompt ( context )
82+ const { systemPrompt } = strategy . getPrompts ( context )
8483
8584 // ErrorFixStrategy should be selected
8685 expect ( systemPrompt ) . toContain ( "Fix Compilation Errors and Warnings" )
8786 } )
8887 } )
8988
90- describe ( "getSuggestionPrompt" , ( ) => {
91- it ( "should delegate to PromptStrategyManager" , ( ) => {
92- const mockDocument = {
93- languageId : "typescript" ,
94- getText : ( ) => "const x = 1;" ,
95- lineAt : ( line : number ) => ( { text : "const x = 1;" } ) ,
96- uri : { toString : ( ) => "file:///test.ts" } ,
97- offsetAt : ( position : vscode . Position ) => 13 ,
98- } as vscode . TextDocument
99-
100- const context : GhostSuggestionContext = {
101- document : mockDocument ,
102- }
103-
104- const prompt = strategy . getSuggestionPrompt ( context )
105-
106- // Should return a structured prompt
107- expect ( prompt ) . toBeDefined ( )
108- expect ( prompt . length ) . toBeGreaterThan ( 0 )
109- } )
110- } )
111-
11289 describe ( "Integration" , ( ) => {
11390 it ( "should work with both system and user prompts" , ( ) => {
11491 const mockDocument = {
@@ -124,8 +101,7 @@ describe("GhostStrategy", () => {
124101 userInput : "Complete this function" ,
125102 }
126103
127- const systemPrompt = strategy . getSystemPrompt ( context )
128- const userPrompt = strategy . getSuggestionPrompt ( context )
104+ const { systemPrompt, userPrompt } = strategy . getPrompts ( context )
129105
130106 // System prompt should contain format instructions
131107 expect ( systemPrompt ) . toContain ( "CRITICAL OUTPUT FORMAT" )
@@ -220,8 +196,7 @@ describe("GhostStrategy", () => {
220196 document : mockDocument ,
221197 }
222198
223- const systemPrompt = strategy . getSystemPrompt ( context )
224- const userPrompt = strategy . getSuggestionPrompt ( context )
199+ const { systemPrompt, userPrompt } = strategy . getPrompts ( context )
225200
226201 expect ( systemPrompt ) . toBeDefined ( )
227202 expect ( systemPrompt . length ) . toBeGreaterThan ( 0 )
@@ -279,8 +254,7 @@ describe("GhostStrategy", () => {
279254 ]
280255
281256 contexts . forEach ( ( context ) => {
282- const systemPrompt = strategy . getSystemPrompt ( context as GhostSuggestionContext )
283- const userPrompt = strategy . getSuggestionPrompt ( context as GhostSuggestionContext )
257+ const { systemPrompt, userPrompt } = strategy . getPrompts ( context as GhostSuggestionContext )
284258
285259 expect ( systemPrompt ) . toBeDefined ( )
286260 expect ( systemPrompt . length ) . toBeGreaterThan ( 0 )
0 commit comments