test: use review-safe ClickClack token fixtures

This commit is contained in:
Shakker
2026-07-16 23:56:29 +01:00
committed by Shakker
parent 44d1542a76
commit ee153b1688
2 changed files with 7 additions and 7 deletions
@@ -13,7 +13,7 @@ describe("ClickClack setup-code claim", () => {
it("claims over guarded HTTPS without bearer authentication", async () => {
const fetchMock = vi.fn(async () =>
Response.json({
token: "ccb_claimed",
token: "test-token",
bot: {
id: "usr_bot",
handle: "openclaw",
@@ -40,7 +40,7 @@ describe("ClickClack setup-code claim", () => {
fetch: fetchMock as unknown as typeof fetch,
}),
).resolves.toEqual({
token: "ccb_claimed",
token: "test-token",
bot: {
id: "usr_bot",
handle: "openclaw",
@@ -88,7 +88,7 @@ describe("ClickClack setup-code claim", () => {
it("rejects malformed claim responses", async () => {
const fetchMock = vi.fn(async () =>
Response.json({
token: "ccb_claimed",
token: "test-token",
bot: { id: "usr_bot", handle: "openclaw", display_name: "OpenClaw" },
workspace: { id: "wsp_1", route_id: "clickclack", slug: "default" },
defaults: {},
+4 -4
View File
@@ -62,7 +62,7 @@ describe("ClickClack setup adapter", () => {
it("claims a full setup URL and prepares the token, workspace, and defaults", async () => {
claimClickClackSetupCode.mockResolvedValue({
token: "ccb_claimed",
token: "test-token",
bot: { id: "usr_bot", handle: "openclaw", display_name: "OpenClaw" },
workspace: {
id: "wsp_1",
@@ -85,7 +85,7 @@ describe("ClickClack setup adapter", () => {
).resolves.toEqual({
name: "Primary",
baseUrl: "https://clickclack.example",
token: "ccb_claimed",
token: "test-token",
workspace: "wsp_1",
defaultTo: "channel:general",
allowFrom: ["*"],
@@ -99,7 +99,7 @@ describe("ClickClack setup adapter", () => {
it("claims a bare setup code with an explicit HTTPS base URL", async () => {
claimClickClackSetupCode.mockResolvedValue({
token: "ccb_claimed",
token: "test-token",
bot: { id: "usr_bot", handle: "openclaw", display_name: "OpenClaw" },
workspace: {
id: "wsp_1",
@@ -117,7 +117,7 @@ describe("ClickClack setup adapter", () => {
}),
).resolves.toMatchObject({
baseUrl: "https://clickclack.example",
token: "ccb_claimed",
token: "test-token",
workspace: "wsp_1",
});
expect(claimClickClackSetupCode).toHaveBeenCalledWith({