"use strict";

require("core-js/modules/es.promise.js");

var _react = require("@testing-library/react");

var _reactRouterDom = require("react-router-dom");

var _App = _interopRequireDefault(require("./App"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

const mockedUsedNavigate = jest.fn();
jest.mock('react-router-dom', () => _objectSpread(_objectSpread({}, jest.requireActual('react-router-dom')), {}, {
  useNavigate: () => mockedUsedNavigate
}));
describe("Testing forgot password", () => {
  it("Should render page of forgot Password", async () => {
    const root = document.createElement('div');
    document.body.appendChild(root);
    const {
      getByText
    } = (0, _react.render)( /*#__PURE__*/React.createElement(_reactRouterDom.MemoryRouter, {
      initialEntries: ['/forgot-password']
    }, /*#__PURE__*/React.createElement(_App.default, null)), root);
    await (0, _react.waitFor)(() => {
      expect(getByText("Send reset password link")).toBeInTheDocument();
    });
  });
  it("Should render page of reset Password", async () => {
    const root = document.createElement('div');
    document.body.appendChild(root);
    const {
      getByText
    } = (0, _react.render)( /*#__PURE__*/React.createElement(_reactRouterDom.MemoryRouter, {
      initialEntries: ['/reset-password/1/2']
    }, /*#__PURE__*/React.createElement(_App.default, null)), root);
    await (0, _react.waitFor)(() => {
      expect(getByText("Reset your Password")).toBeInTheDocument();
    });
  });
});