Skip to content

Commit ffac4ad

Browse files
committed
test(oauth, importExport): strengthen mutation resistance
1 parent 8ef6d95 commit ffac4ad

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

‎src/core/config/__tests__/importExport.spec.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,6 +1282,7 @@ describe("importExport", () => {
12821282

12831283
expect(result.success).toBe(true)
12841284
expect(result.warnings).toEqual(expectedWarnings)
1285+
expect(mockContextProxy.setValues).toHaveBeenCalledTimes(1)
12851286
expect(mockContextProxy.setValues).toHaveBeenCalledWith(
12861287
expect.objectContaining({
12871288
imageGenerationProvider: expectedWarnings ? undefined : providerIdentifiers.openrouter,

‎webview-ui/src/oauth/__tests__/urls.spec.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ describe("OAuth URLs", () => {
2929
version: Package.version,
3030
callback_uri: `vscode://${Package.publisher}.${Package.name}/auth-callback`,
3131
})
32+
expect(getZooCodeAuthUrl()).toContain(
33+
`callback_uri=${encodeURIComponent(`vscode://${Package.publisher}.${Package.name}/auth-callback`)}`,
34+
)
3235
expect(getZooCodeAuthUrl("", "", "")).toBe(getZooCodeAuthUrl())
3336
})
3437

@@ -41,5 +44,8 @@ describe("OAuth URLs", () => {
4144
version: Package.version,
4245
callback_uri: `cursor://${Package.publisher}.${Package.name}/auth-callback`,
4346
})
47+
expect(getZooCodeAuthUrl("cursor")).toContain(
48+
`callback_uri=${encodeURIComponent(`cursor://${Package.publisher}.${Package.name}/auth-callback`)}`,
49+
)
4450
})
4551
})

0 commit comments

Comments
 (0)