test: check read-only auth overlay context · openclaw/openclaw@3abb2ee
shakkernerd
·
2026-05-12
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -58,7 +58,22 @@ describe("auth profiles read-only external auth overlay", () => {
|
58 | 58 | |
59 | 59 | const loaded = loadAuthProfileStoreForRuntime(agentDir, { readOnly: true }); |
60 | 60 | |
61 | | -expect(resolveExternalAuthProfilesWithPluginsMock).toHaveBeenCalled(); |
| 61 | +expect(resolveExternalAuthProfilesWithPluginsMock).toHaveBeenCalledTimes(1); |
| 62 | +const externalAuthCall = resolveExternalAuthProfilesWithPluginsMock.mock.calls[0]?.[0] as |
| 63 | +| { |
| 64 | +config?: unknown; |
| 65 | +context?: { |
| 66 | +agentDir?: string; |
| 67 | +store?: AuthProfileStore; |
| 68 | +workspaceDir?: string; |
| 69 | +}; |
| 70 | +} |
| 71 | +| undefined; |
| 72 | +expect(externalAuthCall?.config).toBeUndefined(); |
| 73 | +expect(externalAuthCall?.context?.agentDir).toBe(agentDir); |
| 74 | +expect(externalAuthCall?.context?.workspaceDir).toBeUndefined(); |
| 75 | +expect(externalAuthCall?.context?.store?.version).toBe(AUTH_STORE_VERSION); |
| 76 | +expect(externalAuthCall?.context?.store?.profiles).toStrictEqual(baseline.profiles); |
62 | 77 | expect(loaded.profiles["minimax-portal:default"]?.type).toBe("oauth"); |
63 | 78 | expect(loaded.profiles["minimax-portal:default"]?.provider).toBe("minimax-portal"); |
64 | 79 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。