Skip to content

Commit 82f0a98

Browse files
test(extension): expect the landed profile record in the second argument
The propagation fix hands ClineProvider the record that actually landed in the cross-instance section instead of a subset rebuilt from the payload, so setConfiguration's second argument now carries savedProfileSettings. This spec asserted that argument exactly, so it went red on CI's coverage shard (platform-unit-test ubuntu-latest) while my local run of the edited file and of the webview spec directory stayed green: the shard runs the package's own project config and my file selection did not. The parent 82f44f8 does not send the key, so this is the fourth pre-existing expectation our change moved, not a red we inherited. Negative control: with src/extension/api.ts and src/core/webview/ClineProvider.ts checked out at 82f44f8 (byte-identical blobs, index reset, no stash) this case fails with 'AssertionError: expected "vi.fn()" to be called with arguments: [ ... (2) ]' and the reported diff drops the savedProfileSettings key, so the expectation is load-bearing rather than decorative. Spec-only change: __tests__ paths never count toward the mutation-diff line total, so the 2128-vs-500 cap number is unaffected by this commit. There is no re-run lever for the red leg (POST /actions/runs/<id>/rerun-failed-jobs returns 403 without admin rights), so this push doubles as the re-trigger for the required contexts.
1 parent 3414aa6 commit 82f0a98

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎src/extension/__tests__/api-set-configuration.spec.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,13 @@ describe("API.setConfiguration", () => {
7474
// Exact side-effect counts: a regression that repeats any of these operations
7575
// (duplicate settings write, duplicate profile save, duplicate webview post) fails.
7676
expect(provider.setValues).toHaveBeenCalledTimes(1)
77-
expect(provider.setValues).toHaveBeenCalledWith(configuration, { savedProfileName: "default" })
77+
// The second argument carries the profile record that actually landed in the
78+
// cross-instance section - what the store reports after saving, here the
79+
// record minus its name/id pair - rather than a reconstruction from the payload.
80+
expect(provider.setValues).toHaveBeenCalledWith(configuration, {
81+
savedProfileName: "default",
82+
savedProfileSettings: { apiProvider: providerIdentifiers.bedrock },
83+
})
7884
expect(provider.contextProxy.setValues).not.toHaveBeenCalled()
7985
expect(provider.providerSettingsManager.saveConfig).toHaveBeenCalledTimes(1)
8086
expect(provider.providerSettingsManager.saveConfig).toHaveBeenCalledWith("default", configuration)

0 commit comments

Comments
 (0)