Skip to content

Commit

Permalink
refactor: update ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Syed-Ali-Abbas-Zaidi committed Jul 7, 2023
1 parent 2cdd0db commit 389962f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ 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
4 changes: 2 additions & 2 deletions packages/catalog-search/src/SearchContext.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, {
createContext, useReducer, useMemo, useEffect,
} from 'react';
import PropTypes from 'prop-types';
import { useLocation, useHistory } from 'react-router-dom';
import { useLocation, useNavigate } from 'react-router-dom';
import { useIsFirstRender } from '@edx/frontend-enterprise-utils';

import {
Expand Down Expand Up @@ -44,7 +44,7 @@ const SearchData = ({ children, searchFacetFilters, trackingName }) => {
);

const { pathname, search } = useLocation();
const navigate = useHistory();
const navigate = useNavigate();

/**
* Applies initial URL query params on page load to the refinements
Expand Down
7 changes: 7 additions & 0 deletions packages/catalog-search/src/tests/SearchFilters.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ 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 389962f

Please sign in to comment.