Enhance documentation, implement Twilio OTP delivery, and update payment gateway methods. Updated AGENTS.md and README.md for clarity on ExecPlans and architecture. Added Twilio as a dependency and implemented capture/refund methods in MoyasarGateway. Improved frontend routing with react-router-dom and added authentication context. Updated styles and localization files for better user experience.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { fireEvent, render, screen, waitFor } from "@testing-library/react";
|
||||
import { vi } from "vitest";
|
||||
import App from "./App.jsx";
|
||||
import { AuthProvider } from "./contexts/AuthContext";
|
||||
import i18n from "./i18n";
|
||||
|
||||
vi.mock("./api/client", () => ({
|
||||
@@ -8,10 +9,14 @@ vi.mock("./api/client", () => ({
|
||||
apiPost: vi.fn()
|
||||
}));
|
||||
|
||||
function TestWrapper({ children }) {
|
||||
return <AuthProvider>{children}</AuthProvider>;
|
||||
}
|
||||
|
||||
describe("App", () => {
|
||||
it("renders the hero copy", async () => {
|
||||
await i18n.changeLanguage("en");
|
||||
render(<App />);
|
||||
render(<App />, { wrapper: TestWrapper });
|
||||
expect(
|
||||
await screen.findByText("Find, compare, and book top salons near you.")
|
||||
).toBeInTheDocument();
|
||||
@@ -19,7 +24,7 @@ describe("App", () => {
|
||||
|
||||
it("switches to Arabic and sets RTL direction", async () => {
|
||||
await i18n.changeLanguage("en");
|
||||
render(<App />);
|
||||
render(<App />, { wrapper: TestWrapper });
|
||||
const arabicButton = screen.getByRole("button", { name: "العربية" });
|
||||
fireEvent.click(arabicButton);
|
||||
await waitFor(() => {
|
||||
|
||||
Reference in New Issue
Block a user