Skip to content

Commit

Permalink
fix: useNavigate being undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
Syed-Ali-Abbas-Zaidi committed Jul 12, 2023
1 parent 389962f commit cd8c8b0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 75 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ jobs:
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }}" >> .npmrc
npm whoami
- name: Clean NPM
run: npm run clean
- name: Install and Setup Dependencies
run: npm ci
# build must come before running linting and tests for the `dist` directory to exist.
Expand Down
84 changes: 20 additions & 64 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions packages/catalog-search/src/tests/FacetListBase.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { renderWithRouter } from '@edx/frontend-enterprise-utils';
import { act, screen, fireEvent } from '@testing-library/react';
import '@testing-library/jest-dom/extend-expect';

import { BrowserRouter } from 'react-router-dom';
import { FREE_ALL_TITLE } from '../SearchFilters';
import FacetListBase from '../FacetListBase';
import { FACET_ATTRIBUTES, SUBJECTS } from '../data/tests/constants';
Expand Down Expand Up @@ -55,7 +54,7 @@ const searchableDropdownProps = {

describe('<FacetListBase />', () => {
test('renders with no options', async () => {
renderWithRouter(<BrowserRouter><SearchData><FacetListBase {...propsForNoItems} /></SearchData></BrowserRouter>);
renderWithRouter(<SearchData><FacetListBase {...propsForNoItems} /></SearchData>);

// assert facet title exists
expect(screen.queryByText(FREE_ALL_TITLE)).toBeInTheDocument();
Expand Down
7 changes: 0 additions & 7 deletions packages/catalog-search/src/tests/SearchFilters.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ import { renderWithSearchContext } from './utils';
import '../../__mocks__/react-instantsearch-dom';
import SearchFilters from '../SearchFilters';

const mockedNavigator = jest.fn();

jest.mock('react-router-dom', () => ({
...jest.requireActual('react-router-dom'),
useNavigate: () => mockedNavigator,
}));

const SearchContextWrapper = () => {
const contextValue = useMemo(() => ({ width: breakpoints.large.maxWidth }), []);
return (
Expand Down

0 comments on commit cd8c8b0

Please sign in to comment.