Skip to content

Commit

Permalink
refactor: update peer deps
Browse files Browse the repository at this point in the history
  • Loading branch information
Syed-Ali-Abbas-Zaidi committed Aug 8, 2023
1 parent 8881e83 commit d19c7ec
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 22 deletions.
2 changes: 1 addition & 1 deletion packages/catalog-search/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"react-test-renderer": "17.0.2"
},
"peerDependencies": {
"@edx/frontend-platform": "5.0.0",
"@edx/frontend-platform": "^5.0.0",
"@edx/paragon": "^19.15.0 || ^20.0.0",
"@fortawesome/free-solid-svg-icons": "^5.8.1",
"@fortawesome/react-fontawesome": "^0.1.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ const propsForActiveRefinements = {
};

describe('<FacetListRefinementBase />', () => {
beforeEach(() => {
jest.clearAllMocks();
});

test('renders with no options', async () => {
renderWithRouter(<SearchData><FacetListRefinementBase {...propsForNoRefinements} /></SearchData>);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { renderWithSearchContext } from './utils';

jest.mock('react-router-dom', () => ({
...jest.requireActual('react-router-dom'),
useNavigate: () => jest.fn(),
useLocation: () => ({
pathname: '/',
}),
Expand Down
14 changes: 6 additions & 8 deletions packages/catalog-search/src/tests/SearchSuggestionItem.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,12 @@ describe('<SeachSuggestionItem />', () => {
},
};

const { container } = renderWithRouter(
<SearchSuggestionItem
url={mockData.program.url}
suggestionItemHandler={mockData.program.suggestionItemHandler}
hit={mockData.program.hit}
disableSuggestionRedirect={mockData.program.disableSuggestionRedirect}
/>,
);
const { container } = renderWithRouter(<SearchSuggestionItem
url={mockData.program.url}
suggestionItemHandler={mockData.program.suggestionItemHandler}
hit={mockData.program.hit}
disableSuggestionRedirect={mockData.program.disableSuggestionRedirect}
/>);
userEvent.click(container.getElementsByClassName('suggestion-item')[0]);
expect(window.location.pathname).toBe(mockData.program.url);
});
Expand Down
12 changes: 5 additions & 7 deletions packages/catalog-search/src/tests/SearchSuggestions.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,11 @@ describe('<SeachSuggestions />', () => {
});

test('redirects to correct page on course click', () => {
const { container } = renderWithRouter(
<SearchSuggestions
enterpriseSlug="test-enterprise"
autoCompleteHits={fakeSuggestionsData.hits}
handleSubmit={handleSubmit}
/>,
);
const { container } = renderWithRouter(<SearchSuggestions
enterpriseSlug="test-enterprise"
autoCompleteHits={fakeSuggestionsData.hits}
handleSubmit={handleSubmit}
/>);

userEvent.click(container.getElementsByClassName('suggestion-item')[0]);
expect(window.location.pathname).toBe('/test-enterprise/course/edX+courseX');
Expand Down
2 changes: 1 addition & 1 deletion packages/hotjar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@
"peerDependencies": {
"react": "^16.12.0 || ^17.0.0",
"react-dom": "^16.12.0 || ^17.0.0",
"react-router-dom": "6.14.2"
"react-router-dom": "^6.0.0"
}
}
4 changes: 2 additions & 2 deletions packages/logistration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@
"react-test-renderer": "17.0.2"
},
"peerDependencies": {
"@edx/frontend-platform": "5.0.0",
"@edx/frontend-platform": "^5.0.0",
"react": "^16.12.0 || ^17.0.0",
"react-dom": "^16.12.0 || ^17.0.0",
"react-router-dom": "6.14.2"
"react-router-dom": "^6.0.0"
}
}
4 changes: 2 additions & 2 deletions packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@
"react-test-renderer": "17.0.2"
},
"peerDependencies": {
"@edx/frontend-platform": "5.0.0",
"@edx/frontend-platform": "^5.0.0",
"react": "^16.12.0 || ^17.0.0",
"react-dom": "^16.12.0 || ^17.0.0",
"react-router-dom": "6.14.2"
"react-router-dom": "^6.0.0"
}
}

0 comments on commit d19c7ec

Please sign in to comment.