Skip to content

Commit 7448edb

Browse files
committed
fix(test): Update context mention and settings tests
1 parent 6819e0d commit 7448edb

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

webview-ui/src/components/settings/__tests__/ContextManagementSettings.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,27 +115,27 @@ describe("ContextManagementSettings", () => {
115115
render(<ContextManagementSettings {...defaultProps} />)
116116
const checkbox = screen.getByTestId("enable-context-synthesization-checkbox")
117117
fireEvent.click(checkbox)
118-
expect(defaultProps.setEnableContextSummarization).toHaveBeenCalledWith(true)
118+
expect(defaultProps.setCachedStateField).toHaveBeenCalledWith("enableContextSummarization", true)
119119
})
120120

121121
it("updates synthesization trigger threshold", () => {
122122
render(<ContextManagementSettings {...defaultProps} enableContextSummarization={true} />) // Enable first
123123
const input = screen.getByTestId("context-synthesization-trigger-threshold-input")
124124
fireEvent.change(input, { target: { value: "95" } })
125-
expect(defaultProps.setContextSummarizationTriggerThreshold).toHaveBeenCalledWith(95)
125+
expect(defaultProps.setCachedStateField).toHaveBeenCalledWith("contextSummarizationTriggerThreshold", 95)
126126
})
127127

128128
it("updates initial turns to keep", () => {
129129
render(<ContextManagementSettings {...defaultProps} enableContextSummarization={true} />) // Enable first
130130
const input = screen.getByTestId("context-synthesization-initial-turns-input")
131131
fireEvent.change(input, { target: { value: "3" } })
132-
expect(defaultProps.setContextSummarizationInitialStaticTurns).toHaveBeenCalledWith(3)
132+
expect(defaultProps.setCachedStateField).toHaveBeenCalledWith("contextSummarizationInitialStaticTurns", 3)
133133
})
134134

135135
it("updates recent turns to keep", () => {
136136
render(<ContextManagementSettings {...defaultProps} enableContextSummarization={true} />) // Enable first
137137
const input = screen.getByTestId("context-synthesization-recent-turns-input")
138138
fireEvent.change(input, { target: { value: "12" } })
139-
expect(defaultProps.setContextSummarizationRecentTurns).toHaveBeenCalledWith(12)
139+
expect(defaultProps.setCachedStateField).toHaveBeenCalledWith("contextSummarizationRecentTurns", 12)
140140
})
141141
})

webview-ui/src/utils/__tests__/context-mentions.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,9 @@ describe("getContextMenuOptions", () => {
9191

9292
it("should return all option types for empty query", () => {
9393
const result = getContextMenuOptions("", "", null, [])
94-
expect(result).toHaveLength(6)
94+
expect(result).toHaveLength(7)
9595
expect(result.map((item) => item.type)).toEqual([
96+
ContextMenuOptionType.Synthesize,
9697
ContextMenuOptionType.Problems,
9798
ContextMenuOptionType.Terminal,
9899
ContextMenuOptionType.URL,

0 commit comments

Comments
 (0)