// __tests__/ModuleNavigationAlt.test.tsx
import { render } from "@testing-library/react-native";
import { Alert } from "react-native";
import { renderWithExperimentalEnabledContextProvider } from "../../../utils/testing";
import { ModuleNavigationAlt } from "../ModuleNavigationAlt";
const onPress = () => {
Alert.alert("Alert", "Action triggered");
};
describe("ModuleNavigationAlt - Snapshot", () => {
it("Loading state", () => {
const { toJSON } = render(
);
expect(toJSON()).toMatchSnapshot();
});
it("Title only + chevron (onPress)", () => {
const { toJSON } = render(
);
expect(toJSON()).toMatchSnapshot();
});
it("Title + Subtitle", () => {
const { toJSON } = render(
);
expect(toJSON()).toMatchSnapshot();
});
it("With Badge (badge + chevron)", () => {
const { toJSON } = render(
);
expect(toJSON()).toMatchSnapshot();
});
it("With Image (no icon) + chevron (onPress)", () => {
const { toJSON } = render(
);
expect(toJSON()).toMatchSnapshot();
});
});
describe("ModuleNavigationAlt - Snapshot (Experimental Enabled)", () => {
it("Loading state", () => {
const { toJSON } = renderWithExperimentalEnabledContextProvider(
);
expect(toJSON()).toMatchSnapshot();
});
it("Title only + chevron (onPress)", () => {
const { toJSON } = renderWithExperimentalEnabledContextProvider(
);
expect(toJSON()).toMatchSnapshot();
});
it("Title + Subtitle", () => {
const { toJSON } = renderWithExperimentalEnabledContextProvider(
);
expect(toJSON()).toMatchSnapshot();
});
it("With Badge (badge + chevron)", () => {
const { toJSON } = renderWithExperimentalEnabledContextProvider(
);
expect(toJSON()).toMatchSnapshot();
});
it("With Image (no icon) + chevron (onPress) - Experimental", () => {
const { toJSON } = renderWithExperimentalEnabledContextProvider(
);
expect(toJSON()).toMatchSnapshot();
});
it("should forward testID", () => {
const { getByTestId } = render(
);
expect(getByTestId("module-navigation-alt")).toBeTruthy();
});
});