Avatar Customization + Update Agent Brain (#23)

Co-authored-by: iamlukethedev <iamlukethedev@users.noreply.github.com>
This commit is contained in:
Luke The Dev
2026-03-20 23:05:14 -05:00
committed by GitHub
parent a5b0895dd8
commit 65c2b9cf85
39 changed files with 2803 additions and 551 deletions
+15 -16
View File
@@ -1,31 +1,30 @@
import { expect, test } from "@playwright/test";
import { stubStudioRoute } from "./helpers/studioRoute";
test("connection settings persist to the studio settings API", async ({ page }) => {
test("voice reply settings persist to the studio settings API", async ({ page }) => {
await stubStudioRoute(page);
await page.goto("/");
await page.getByTestId("studio-menu-toggle").click();
await page.getByTestId("gateway-settings-toggle").click();
await expect(page.getByLabel("Upstream URL")).toBeVisible();
await page.getByTitle("Voice reply settings").click();
await expect(page.getByRole("switch", { name: "Voice replies" })).toBeVisible();
await page.waitForFunction(() => {
const element = document.querySelector('[aria-label="Voice replies"]');
return element instanceof HTMLButtonElement && !element.disabled;
});
await page.getByLabel("Upstream URL").fill("ws://gateway.example:18789");
await page.getByLabel("Upstream token").fill("token-123");
const request = await page.waitForRequest((req) => {
const requestPromise = page.waitForRequest((req) => {
if (!req.url().includes("/api/studio") || req.method() !== "PUT") {
return false;
}
const payload = JSON.parse(req.postData() ?? "{}") as Record<string, unknown>;
const gateway = (payload.gateway ?? {}) as { url?: string; token?: string };
return gateway.url === "ws://gateway.example:18789" && gateway.token === "token-123";
const voiceReplies = (payload.voiceReplies ?? {}) as Record<string, { enabled?: boolean }>;
return Object.values(voiceReplies).some((entry) => entry.enabled === true);
});
await page.getByRole("switch", { name: "Voice replies" }).click();
const request = await requestPromise;
const payload = JSON.parse(request.postData() ?? "{}") as Record<string, unknown>;
const gateway = (payload.gateway ?? {}) as { url?: string; token?: string };
expect(gateway.url).toBe("ws://gateway.example:18789");
expect(gateway.token).toBe("token-123");
await expect(
page.getByRole("button", { name: /^(Connect|Disconnect)$/ })
).toBeVisible();
const voiceReplies = (payload.voiceReplies ?? {}) as Record<string, { enabled?: boolean }>;
expect(Object.keys(voiceReplies).length).toBeGreaterThan(0);
expect(Object.values(voiceReplies).some((entry) => entry.enabled === true)).toBe(true);
});