"use strict";

var _reactNative = require("@testing-library/react-native");
var _reactNative2 = require("react-native");
var _testing = require("../../../utils/testing");
var _ModuleNavigationAlt = require("../ModuleNavigationAlt");
var _jsxRuntime = require("react/jsx-runtime");
// __tests__/ModuleNavigationAlt.test.tsx

const onPress = () => {
  _reactNative2.Alert.alert("Alert", "Action triggered");
};
describe("ModuleNavigationAlt - Snapshot", () => {
  it("Loading state", () => {
    const {
      toJSON
    } = (0, _reactNative.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ModuleNavigationAlt.ModuleNavigationAlt, {
      isLoading: true,
      loadingAccessibilityLabel: "loading items"
    }));
    expect(toJSON()).toMatchSnapshot();
  });
  it("Title only + chevron (onPress)", () => {
    const {
      toJSON
    } = (0, _reactNative.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ModuleNavigationAlt.ModuleNavigationAlt, {
      title: "My Title",
      onPress: onPress,
      icon: "spid"
    }));
    expect(toJSON()).toMatchSnapshot();
  });
  it("Title + Subtitle", () => {
    const {
      toJSON
    } = (0, _reactNative.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ModuleNavigationAlt.ModuleNavigationAlt, {
      title: "My Title",
      subtitle: "A nice subtitle",
      icon: "spid"
    }));
    expect(toJSON()).toMatchSnapshot();
  });
  it("With Badge (badge + chevron)", () => {
    const {
      toJSON
    } = (0, _reactNative.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ModuleNavigationAlt.ModuleNavigationAlt, {
      title: "With Badge",
      onPress: onPress,
      badge: {
        text: "TEST",
        variant: "highlight"
      },
      icon: "spid"
    }));
    expect(toJSON()).toMatchSnapshot();
  });
  it("With Image (no icon) + chevron (onPress)", () => {
    const {
      toJSON
    } = (0, _reactNative.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ModuleNavigationAlt.ModuleNavigationAlt, {
      title: "With Image",
      image: {
        uri: "https://example.com/icon.png"
      },
      onPress: onPress
    }));
    expect(toJSON()).toMatchSnapshot();
  });
});
describe("ModuleNavigationAlt - Snapshot (Experimental Enabled)", () => {
  it("Loading state", () => {
    const {
      toJSON
    } = (0, _testing.renderWithExperimentalEnabledContextProvider)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ModuleNavigationAlt.ModuleNavigationAlt, {
      isLoading: true,
      loadingAccessibilityLabel: "loading items"
    }));
    expect(toJSON()).toMatchSnapshot();
  });
  it("Title only + chevron (onPress)", () => {
    const {
      toJSON
    } = (0, _testing.renderWithExperimentalEnabledContextProvider)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ModuleNavigationAlt.ModuleNavigationAlt, {
      title: "My Title",
      onPress: onPress,
      icon: "spid"
    }));
    expect(toJSON()).toMatchSnapshot();
  });
  it("Title + Subtitle", () => {
    const {
      toJSON
    } = (0, _testing.renderWithExperimentalEnabledContextProvider)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ModuleNavigationAlt.ModuleNavigationAlt, {
      title: "My Title",
      subtitle: "A nice subtitle",
      icon: "spid"
    }));
    expect(toJSON()).toMatchSnapshot();
  });
  it("With Badge (badge + chevron)", () => {
    const {
      toJSON
    } = (0, _testing.renderWithExperimentalEnabledContextProvider)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ModuleNavigationAlt.ModuleNavigationAlt, {
      title: "With Badge",
      onPress: onPress,
      badge: {
        text: "TEST",
        variant: "highlight"
      },
      icon: "spid"
    }));
    expect(toJSON()).toMatchSnapshot();
  });
  it("With Image (no icon) + chevron (onPress) - Experimental", () => {
    const {
      toJSON
    } = (0, _testing.renderWithExperimentalEnabledContextProvider)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ModuleNavigationAlt.ModuleNavigationAlt, {
      title: "With Image",
      image: {
        uri: "https://example.com/icon.png"
      },
      onPress: onPress
    }));
    expect(toJSON()).toMatchSnapshot();
  });
  it("should forward testID", () => {
    const {
      getByTestId
    } = (0, _reactNative.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ModuleNavigationAlt.ModuleNavigationAlt, {
      testID: "module-navigation-alt",
      title: "With Image",
      image: {
        uri: "https://example.com/icon.png"
      },
      onPress: jest.fn()
    }));
    expect(getByTestId("module-navigation-alt")).toBeTruthy();
  });
});
//# sourceMappingURL=ModuleNavigationAlt.test.js.map