Avatar Customization + Update Agent Brain (#23)
Co-authored-by: iamlukethedev <iamlukethedev@users.noreply.github.com>
This commit is contained in:
@@ -47,18 +47,18 @@ describe("studio settings route", () => {
|
||||
|
||||
const response = await GET();
|
||||
const body = (await response.json()) as {
|
||||
settings?: { gateway?: { url?: string; token?: string } | null };
|
||||
localGatewayDefaults?: { url?: string; token?: string } | null;
|
||||
settings?: { gateway?: { url?: string; tokenConfigured?: boolean } | null };
|
||||
localGatewayDefaults?: { url?: string; tokenConfigured?: boolean } | null;
|
||||
};
|
||||
|
||||
expect(response.status).toBe(200);
|
||||
expect(body.localGatewayDefaults).toEqual({
|
||||
url: "ws://localhost:18791",
|
||||
token: "local-token",
|
||||
tokenConfigured: true,
|
||||
});
|
||||
expect(body.settings?.gateway).toEqual({
|
||||
url: "ws://localhost:18791",
|
||||
token: "local-token",
|
||||
tokenConfigured: true,
|
||||
});
|
||||
});
|
||||
|
||||
@@ -82,6 +82,11 @@ describe("studio settings route", () => {
|
||||
|
||||
const patch = {
|
||||
gateway: { url: "ws://example.test:1234", token: "t" },
|
||||
office: {
|
||||
"ws://example.test:1234": {
|
||||
title: "Orbit Control",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const putResponse = await PUT({
|
||||
@@ -91,16 +96,31 @@ describe("studio settings route", () => {
|
||||
|
||||
const getResponse = await GET();
|
||||
const body = (await getResponse.json()) as {
|
||||
settings?: { gateway?: { url?: string; token?: string } | null };
|
||||
settings?: {
|
||||
gateway?: { url?: string; tokenConfigured?: boolean } | null;
|
||||
office?: Record<string, { title?: string }>;
|
||||
};
|
||||
};
|
||||
|
||||
expect(getResponse.status).toBe(200);
|
||||
expect(body.settings?.gateway).toEqual({ url: "ws://example.test:1234", token: "t" });
|
||||
expect(body.settings?.gateway).toEqual({
|
||||
url: "ws://example.test:1234",
|
||||
tokenConfigured: true,
|
||||
});
|
||||
expect(body.settings?.office?.["ws://example.test:1234"]).toEqual({
|
||||
title: "Orbit Control",
|
||||
});
|
||||
|
||||
const settingsPath = path.join(tempDir, "claw3d", "settings.json");
|
||||
expect(fs.existsSync(settingsPath)).toBe(true);
|
||||
const raw = fs.readFileSync(settingsPath, "utf8");
|
||||
const parsed = JSON.parse(raw) as { gateway?: { url?: string; token?: string } | null };
|
||||
const parsed = JSON.parse(raw) as {
|
||||
gateway?: { url?: string; token?: string } | null;
|
||||
office?: Record<string, { title?: string }>;
|
||||
};
|
||||
expect(parsed.gateway).toEqual({ url: "ws://example.test:1234", token: "t" });
|
||||
expect(parsed.office?.["ws://example.test:1234"]).toEqual({
|
||||
title: "Orbit Control",
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user