mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-21 10:16:44 +00:00
test: use review-safe ClickClack token fixtures
This commit is contained in:
@@ -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: {},
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user