test: tighten models auth context assertion · openclaw/openclaw@9dc8131
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -533,25 +533,25 @@ describe("modelsAuthLoginCommand", () => {
|
533 | 533 | }, |
534 | 534 | }; |
535 | 535 | const note = vi.fn(async () => {}); |
| 536 | +const select = vi.fn(); |
536 | 537 | mocks.createClackPrompter.mockReturnValue({ |
537 | 538 | note, |
538 | | -select: vi.fn(), |
| 539 | + select, |
539 | 540 | }); |
540 | 541 | const runApiKeyAuth = vi.fn(); |
541 | 542 | const runClaudeCliMigration = vi.fn().mockImplementation(async (ctx) => { |
542 | 543 | expect(ctx.config).toEqual(currentConfig); |
543 | 544 | expect(ctx.agentDir).toBe("/tmp/openclaw/agents/main"); |
544 | 545 | expect(ctx.workspaceDir).toBe("/tmp/openclaw/workspace"); |
545 | | -expect(ctx.prompter).toMatchObject({ note, select: expect.any(Function) }); |
| 546 | +expect(ctx.prompter.note).toBe(note); |
| 547 | +expect(ctx.prompter.select).toBe(select); |
546 | 548 | expect(ctx.runtime).toBe(runtime); |
547 | 549 | expect(ctx.env).toBe(process.env); |
548 | 550 | expect(ctx.allowSecretRefPrompt).toBe(false); |
549 | 551 | expect(ctx.isRemote).toBe(false); |
550 | 552 | await ctx.openUrl("https://example.com/auth"); |
551 | 553 | expect(mocks.openUrl).toHaveBeenCalledWith("https://example.com/auth"); |
552 | | -expect(ctx.oauth).toMatchObject({ |
553 | | -createVpsAwareHandlers: expect.any(Function), |
554 | | -}); |
| 554 | +expect(ctx.oauth.createVpsAwareHandlers).toBeTypeOf("function"); |
555 | 555 | return { |
556 | 556 | profiles: [], |
557 | 557 | defaultModel: "claude-cli/claude-sonnet-4-6", |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。