Add full shell, replaceable Omics adapter and bilingual interaction
Implement approved specification #32 and tickets #33-#37. Keep host authentication server-verified and pin session interaction language. Compile scoped base selectors for browser compatibility and retain full gutters during CSS pruning.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { render, screen } from "@testing-library/react";
|
||||
import { act, render, screen } from "@testing-library/react";
|
||||
import { setLocale } from "../i18n";
|
||||
import userEvent from "@testing-library/user-event";
|
||||
import { useState } from "react";
|
||||
import { ErrorBoundary } from "./ErrorBoundary";
|
||||
@@ -16,9 +17,18 @@ beforeEach(() => {
|
||||
errorSpy = vi.spyOn(console, "error").mockImplementation(() => {});
|
||||
});
|
||||
afterEach(() => {
|
||||
act(() => setLocale("en"));
|
||||
errorSpy.mockRestore();
|
||||
});
|
||||
|
||||
test("updates an already displayed error boundary when the locale changes", () => {
|
||||
render(<ErrorBoundary label="document"><Boom boom label="SELECT * malformed" /></ErrorBoundary>);
|
||||
act(() => setLocale("it"));
|
||||
expect(screen.getByRole("alert")).toHaveTextContent("Impossibile visualizzare questo elemento (documento).");
|
||||
expect(screen.getByRole("button", { name: "Riprova" })).toBeVisible();
|
||||
expect(screen.getByText("SELECT * malformed")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test("renders children when nothing throws", () => {
|
||||
render(
|
||||
<ErrorBoundary>
|
||||
|
||||
Reference in New Issue
Block a user