mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 06:59:34 +00:00
test: dedupe agent tests and session helpers
This commit is contained in:
13
src/test-utils/auth-token-assertions.ts
Normal file
13
src/test-utils/auth-token-assertions.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { expect } from "vitest";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
|
||||
export function expectGeneratedTokenPersistedToGatewayAuth(params: {
|
||||
generatedToken?: string;
|
||||
authToken?: string;
|
||||
persistedConfig?: OpenClawConfig;
|
||||
}) {
|
||||
expect(params.generatedToken).toMatch(/^[0-9a-f]{48}$/);
|
||||
expect(params.authToken).toBe(params.generatedToken);
|
||||
expect(params.persistedConfig?.gateway?.auth?.mode).toBe("token");
|
||||
expect(params.persistedConfig?.gateway?.auth?.token).toBe(params.generatedToken);
|
||||
}
|
||||
Reference in New Issue
Block a user