Skip to content

Commit 46e328c

Browse files
author
Reid
committed
test(terminal): group output collapse preference cases
1 parent a33c980 commit 46e328c

1 file changed

Lines changed: 23 additions & 15 deletions

File tree

‎src/core/webview/__tests__/webviewMessageHandler.spec.ts‎

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2971,22 +2971,30 @@ describe("webviewMessageHandler - telemetrySetting", () => {
29712971
})
29722972
})
29732973

2974-
it.each([true, false, undefined])(
2975-
"persists the output collapse preference (%s) without changing terminal mode",
2976-
async (value) => {
2974+
describe("webviewMessageHandler - collapseCommandOutputByDefault", () => {
2975+
beforeEach(() => {
29772976
vi.clearAllMocks()
2978-
await webviewMessageHandler(mockClineProvider, {
2979-
type: "updateSettings",
2980-
updatedSettings: { collapseCommandOutputByDefault: value },
2981-
})
2982-
expect(mockClineProvider.contextProxy.setValue).toHaveBeenCalledWith("collapseCommandOutputByDefault", value)
2983-
expect(mockClineProvider.contextProxy.setValue).not.toHaveBeenCalledWith(
2984-
"terminalShellIntegrationDisabled",
2985-
expect.anything(),
2986-
)
2987-
expect(mockClineProvider.postStateToWebview).toHaveBeenCalledTimes(1)
2988-
},
2989-
)
2977+
})
2978+
2979+
it.each([true, false, undefined])(
2980+
"persists the output collapse preference (%s) without changing terminal mode",
2981+
async (value) => {
2982+
await webviewMessageHandler(mockClineProvider, {
2983+
type: "updateSettings",
2984+
updatedSettings: { collapseCommandOutputByDefault: value },
2985+
})
2986+
expect(mockClineProvider.contextProxy.setValue).toHaveBeenCalledWith(
2987+
"collapseCommandOutputByDefault",
2988+
value,
2989+
)
2990+
expect(mockClineProvider.contextProxy.setValue).not.toHaveBeenCalledWith(
2991+
"terminalShellIntegrationDisabled",
2992+
expect.anything(),
2993+
)
2994+
expect(mockClineProvider.postStateToWebview).toHaveBeenCalledTimes(1)
2995+
},
2996+
)
2997+
})
29902998

29912999
describe("updateProfileModel", () => {
29923000
let updateProfileModel: Mock<ClineProvider["updateProfileModel"]>

0 commit comments

Comments
 (0)