fix(i18n): localize discovery and accounts
This commit is contained in:
@@ -4,6 +4,7 @@ import { render, screen, waitFor } from "@testing-library/react";
|
||||
import userEvent from "@testing-library/user-event";
|
||||
import { ToastProvider } from "./toast";
|
||||
import { api } from "./api";
|
||||
import { I18nProvider } from "./i18n/I18nProvider";
|
||||
import EmailProviderConnections from "./components/EmailProviderConnections";
|
||||
|
||||
jest.mock("./api", () => ({
|
||||
@@ -21,7 +22,7 @@ const mockedApi = api as jest.Mocked<typeof api>;
|
||||
function renderComponent() {
|
||||
return render(
|
||||
<ToastProvider>
|
||||
<EmailProviderConnections />
|
||||
<I18nProvider><EmailProviderConnections /></I18nProvider>
|
||||
</ToastProvider>,
|
||||
);
|
||||
}
|
||||
@@ -29,6 +30,18 @@ function renderComponent() {
|
||||
describe("EmailProviderConnections", () => {
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
window.localStorage.clear();
|
||||
});
|
||||
|
||||
it("renders connection controls in Norwegian Bokmål", async () => {
|
||||
window.localStorage.setItem("uiLanguage", "nb");
|
||||
mockedApi.get.mockResolvedValue({ data: { connected: false } } as any);
|
||||
|
||||
renderComponent();
|
||||
|
||||
expect(await screen.findByText("Tilkoblede e-postkontoer")).toBeInTheDocument();
|
||||
expect(screen.getByLabelText("IMAP-vert")).toBeInTheDocument();
|
||||
expect(screen.getByRole("button", { name: "Koble til IMAP-konto" })).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("renders connected state for Gmail and Outlook, disconnected form for IMAP", async () => {
|
||||
|
||||
Reference in New Issue
Block a user