You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
685 B
32 lines
685 B
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();
|
|
});
|
|
});
|