diff --git a/client/modules/IDE/components/SketchList.jsx b/client/modules/IDE/components/SketchList.jsx index e998137384..c792fd767d 100644 --- a/client/modules/IDE/components/SketchList.jsx +++ b/client/modules/IDE/components/SketchList.jsx @@ -3,6 +3,7 @@ import classNames from 'classnames'; import React, { useEffect, useState, useCallback } from 'react'; import { Helmet } from 'react-helmet'; import { connect } from 'react-redux'; +import { useTranslation } from 'react-i18next'; import { bindActionCreators } from 'redux'; import * as ProjectsActions from '../actions/projects'; // Added Projects actions import * as CollectionsActions from '../actions/collections'; // Added Collections actions @@ -25,11 +26,11 @@ const SketchList = ({ sorting, toggleDirectionForField, resetSorting, - t, mobile }) => { const [isInitialDataLoad, setIsInitialDataLoad] = useState(true); const [sketchToAddToCollection, setSketchToAddToCollection] = useState(null); + const { t } = useTranslation(); useEffect(() => { getProjects(username); @@ -98,11 +99,13 @@ const SketchList = ({ {field === fieldName && (direction === SortingActions.DIRECTION.ASC ? ( ) : ( @@ -192,8 +195,7 @@ SketchList.propTypes = { field: PropTypes.string.isRequired, direction: PropTypes.string.isRequired }).isRequired, - mobile: PropTypes.bool, - t: PropTypes.func.isRequired + mobile: PropTypes.bool }; SketchList.defaultProps = { diff --git a/client/modules/IDE/components/SketchList.unit.test.jsx b/client/modules/IDE/components/SketchList.unit.test.jsx index 2600cb85f6..9110c43951 100644 --- a/client/modules/IDE/components/SketchList.unit.test.jsx +++ b/client/modules/IDE/components/SketchList.unit.test.jsx @@ -8,22 +8,6 @@ import SketchList from './SketchList'; import { reduxRender, fireEvent, screen, within } from '../../../test-utils'; import { initialTestState } from '../../../testData/testReduxStore'; -jest.mock('react-i18next', () => ({ - useTranslation: () => ({ - t: (key) => key, - i18n: { - changeLanguage: jest.fn(), - language: 'en-US' - } - }), - initReactI18next: { - type: '3rdParty', - init: jest.fn() - } -})); - -jest.mock('../../../i18n'); - const server = setupServer( rest.get(`/${initialTestState.user.username}/projects`, (req, res, ctx) => // it just needs to return something so it doesn't throw an error diff --git a/client/modules/User/pages/DashboardView.jsx b/client/modules/User/pages/DashboardView.jsx index d729a18e88..fcde949cd7 100644 --- a/client/modules/User/pages/DashboardView.jsx +++ b/client/modules/User/pages/DashboardView.jsx @@ -107,12 +107,7 @@ const DashboardView = () => { case TabKey.sketches: default: return ( - + ); } };