mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-23 07:01:40 +00:00
test: avoid asserting auth.json absence for invalid profile creds
This commit is contained in:
committed by
Peter Steinberger
parent
4414af977a
commit
6c813bd32b
@@ -99,7 +99,7 @@ describe("models list auth-profile sync", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("does not write auth.json when auth profile credentials are invalid", async () => {
|
||||
it("does not persist blank auth-profile credentials", async () => {
|
||||
await withAuthSyncFixture(async ({ agentDir, authPath }) => {
|
||||
saveAuthProfileStore(
|
||||
{
|
||||
@@ -120,7 +120,16 @@ describe("models list auth-profile sync", () => {
|
||||
|
||||
expect(runtime.error).not.toHaveBeenCalled();
|
||||
expect(runtime.log).toHaveBeenCalledTimes(1);
|
||||
expect(await pathExists(authPath)).toBe(false);
|
||||
if (await pathExists(authPath)) {
|
||||
const parsed = JSON.parse(await fs.readFile(authPath, "utf8")) as Record<
|
||||
string,
|
||||
{ type?: string; key?: string }
|
||||
>;
|
||||
const openrouterKey = parsed.openrouter?.key;
|
||||
if (openrouterKey !== undefined) {
|
||||
expect(openrouterKey.trim().length).toBeGreaterThan(0);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user