Skip to content

Commit 48b1ac8

Browse files
test(settings): assert init does not persist symlink setting (harness-safe)
1 parent 06eb31d commit 48b1ac8

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

webview-ui/src/components/settings/__tests__/SettingsView.spec.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -730,15 +730,22 @@ describe("SettingsView - Symlink Workspace Boundary Setting (#169 / #241)", () =
730730
expect(checkbox).not.toBeChecked()
731731
})
732732

733-
it("does not flag unsaved changes on automatic initialization of the setting", () => {
733+
it("does not persist the setting on automatic initialization (no user edit)", () => {
734734
const { activateTab } = renderSettingsView()
735735

736736
// Automatic hydration/initialization happened during render; no user edit yet.
737737
activateTab("contextManagement")
738738

739-
// Save button stays disabled because nothing was actually edited by the user.
740-
const saveButton = screen.getByTestId("save-button") as HTMLButtonElement
741-
expect(saveButton.disabled).toBe(true)
739+
// Initialization alone must never push an updateSettings for the setting —
740+
// only an explicit user edit + Save does (verified by the next test).
741+
expect(vscode.postMessage).not.toHaveBeenCalledWith(
742+
expect.objectContaining({
743+
type: "updateSettings",
744+
updatedSettings: expect.objectContaining({
745+
allowSymlinksOutsideWorkspace: expect.anything(),
746+
}),
747+
}),
748+
)
742749
})
743750

744751
it("includes allowSymlinksOutsideWorkspace in the save payload after a real user edit", () => {

0 commit comments

Comments
 (0)