import {render} from '@testing-library/react';
import configureStore from "redux-mock-store";

import BlogSearch from './blog-search';
import {Provider} from "react-redux";

jest.mock("next/router", () => ({
  useRouter() {
    return {
      route: "/",
      pathname: "",
      query: "",
      asPath: "",
    };
  },
}));

describe('BlogSearch', () => {
  const initialState = {results: []};
  const mockStore = configureStore();
  let store;

  it('should render successfully', () => {
    store = mockStore(initialState);
    const {baseElement} = render(
      <Provider store={store}>
        <BlogSearch />
      </Provider>);
    expect(baseElement).toBeTruthy();
  });
});
