Wire payments UI and fix frontend tests

This commit is contained in:
2026-02-28 13:15:41 +03:00
parent f3c93f500e
commit a150b18fe7
9 changed files with 4815 additions and 5 deletions
+10 -3
View File
@@ -1,23 +1,30 @@
import { fireEvent, render, screen, waitFor } from "@testing-library/react";
import { vi } from "vitest";
import App from "./App.jsx";
import i18n from "./i18n";
vi.mock("./api/client", () => ({
apiGet: vi.fn().mockResolvedValue([]),
apiPost: vi.fn()
}));
describe("App", () => {
it("renders the hero copy", async () => {
await i18n.changeLanguage("en");
render(<App />);
expect(
screen.getByText("Find, compare, and book top salons near you.")
await screen.findByText("Find, compare, and book top salons near you.")
).toBeInTheDocument();
});
it("switches to Arabic and sets RTL direction", async () => {
await i18n.changeLanguage("en");
render(<App />);
fireEvent.click(screen.getByRole("button", { name: "العربية" }));
const arabicButton = screen.getByRole("button", { name: "العربية" });
fireEvent.click(arabicButton);
await waitFor(() => {
expect(document.documentElement.dir).toBe("rtl");
});
expect(screen.getByText("الصالونات")).toBeInTheDocument();
expect(arabicButton).toHaveClass("active");
});
});