import { render } from "@testing-library/react";
import { Provider } from "react-redux";
import { Router } from "react-router-dom";
import NavbarComponent from "../../components/MUI/NavbarComponent";
import store from "../../store";
import history from "../../store/utils/history";

jest.mock("react-router-dom", () => ({
  ...jest.requireActual("react-router-dom"),
  useLocation: () => ({
    pathname: "localhost:3000/ads",
  }),
}));

describe("navbar ui tests", () => {
  beforeEach(() => {});

  const cont = (
    <Provider store={store}>
      <Router history={history}>
        <NavbarComponent />
      </Router>
    </Provider>
  );

  afterEach(() => {
    jest.restoreAllMocks();
  });

  it("should render", () => {
    var {container} = render(cont);
    expect(container.getElementsByClassName('text-blue')[0]).toBeDefined()
  });
});
