refactor(frontend): isolate audio meters and apply settings on save
This commit is contained in:
@@ -62,8 +62,9 @@ describe("React application", () => {
|
||||
await user.click(await screen.findByRole("button", { name: "Configuración" }));
|
||||
expect(document.documentElement.dataset.theme).toBe("white");
|
||||
await user.selectOptions(screen.getByRole("combobox"), "Serena");
|
||||
expect(localStorage.getItem("s2s.ws.voice")).toBe("Serena");
|
||||
expect(localStorage.getItem("s2s.ws.voice")).toBeNull();
|
||||
await user.click(screen.getByRole("button", { name: "Guardar" }));
|
||||
expect(localStorage.getItem("s2s.ws.voice")).toBe("Serena");
|
||||
expect(screen.queryByRole("dialog")).not.toBeInTheDocument();
|
||||
view.unmount();
|
||||
render(
|
||||
@@ -74,6 +75,19 @@ describe("React application", () => {
|
||||
await user.click(await screen.findByRole("button", { name: "Configuración" }));
|
||||
expect(screen.getByRole("combobox")).toHaveValue("Serena");
|
||||
});
|
||||
it("discards unsaved settings on cancel while keeping live noise-gate calibration", async () => {
|
||||
const user = userEvent.setup();
|
||||
render(<App />);
|
||||
await user.click(await screen.findByRole("button", { name: "Configuración" }));
|
||||
await user.selectOptions(screen.getByRole("combobox"), "Serena");
|
||||
fireEvent.change(screen.getByRole("slider"), { target: { value: "-35" } });
|
||||
await user.click(screen.getByRole("button", { name: "Cancelar" }));
|
||||
await user.click(screen.getByRole("button", { name: "Configuración" }));
|
||||
expect(screen.getByRole("combobox")).toHaveValue("Aiden");
|
||||
expect(screen.getByRole("slider")).toHaveValue("-35");
|
||||
expect(localStorage.getItem("s2s.ws.voice")).toBeNull();
|
||||
expect(localStorage.getItem("s2s.ws.noiseGate")).toBe("-35");
|
||||
});
|
||||
it("saves and clears session-only RAG context and supports keyboard dialog dismissal", async () => {
|
||||
const user = userEvent.setup();
|
||||
render(<App />);
|
||||
|
||||
Reference in New Issue
Block a user