Skip to content

Commit 04cc9e4

Browse files
refactor: using src as an import alias
1 parent e7ff01a commit 04cc9e4

File tree

14 files changed

+23
-20
lines changed

14 files changed

+23
-20
lines changed

src/app.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { App } from '@openedx/frontend-base';
2-
import { appId } from './constants';
3-
import routes from './routes';
4-
import messages from './i18n';
2+
import { appId } from '@src/constants';
3+
import routes from '@src/routes';
4+
import messages from '@src/i18n';
55

66
const app: App = {
77
appId,

src/cohorts/CohortsPage.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { screen } from '@testing-library/react';
22
import userEvent from '@testing-library/user-event';
33
import CohortsPage from './CohortsPage';
44
import { useCohorts, useCohortStatus, useToggleCohorts } from './data/apiHook';
5-
import { renderWithIntl } from '../testUtils';
5+
import { renderWithIntl } from '@src/testUtils';
66
import messages from './messages';
77
import { CohortProvider } from './components/CohortContext';
88

src/cohorts/components/DisableCohortsModal.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { screen } from '@testing-library/react';
22
import userEvent from '@testing-library/user-event';
33
import DisableCohortsModal from './DisableCohortsModal';
4-
import { renderWithIntl } from '../../testUtils';
4+
import { renderWithIntl } from '@src/testUtils';
55
import messages from '../messages';
66

77
describe('DisableCohortsModal', () => {

src/cohorts/components/DisabledCohortsView.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { screen } from '@testing-library/react';
2-
import { renderWithIntl } from '../../testUtils';
2+
import { renderWithIntl } from '@src/testUtils';
33
import messages from '../messages';
44
import DisabledCohortsView from './DisabledCohortsView';
55
import userEvent from '@testing-library/user-event';

src/cohorts/data/api.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { getCohortStatus, getCohorts, toggleCohorts } from './api';
22
import { camelCaseObject, getAppConfig, getAuthenticatedHttpClient } from '@openedx/frontend-base';
3-
import { appId } from '../../constants';
3+
import { appId } from '@src/constants';
44

55
jest.mock('@openedx/frontend-base');
66

src/cohorts/data/queryKeys.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { appId } from '../../constants';
1+
import { appId } from '@src/constants';
22

33
export const cohortsQueryKeys = {
44
all: [appId, 'cohorts'] as const,

src/courseInfo/CourseInfoPage.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { screen } from '@testing-library/react';
22
import { BrowserRouter } from 'react-router-dom';
33
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
44
import CourseInfoPage from './CourseInfoPage';
5-
import { renderWithIntl } from '../testUtils';
5+
import { renderWithIntl } from '@src/testUtils';
66

77
jest.mock('./components/generalCourseInfo', () => ({
88
GeneralCourseInfo: () => <div>General Course Info Component</div>,

src/courseInfo/CourseInfoPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { Container } from '@openedx/paragon';
2-
import { GeneralCourseInfo } from './components/generalCourseInfo';
2+
import { GeneralCourseInfo } from '@src/courseInfo/components/generalCourseInfo';
33

44
const CourseInfoPage = () => {
55
return (
6-
<Container className="mt-4.5 mb-4" fluid="xl">
6+
<Container className="mt-4.5 mb-4" fluid>
77
<GeneralCourseInfo />
88
</Container>
99
);

src/courseInfo/components/generalCourseInfo/GeneralCourseInfo.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { screen } from '@testing-library/react';
22
import { BrowserRouter } from 'react-router-dom';
33
import { GeneralCourseInfo } from './GeneralCourseInfo';
4-
import { useCourseInfo } from '../../../data/apiHook';
4+
import { useCourseInfo } from '@src/data/apiHook';
55
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
6-
import { createQueryMock, renderWithIntl } from '../../../testUtils';
6+
import { createQueryMock, renderWithIntl } from '@src/testUtils';
77

8-
jest.mock('../../../data/apiHook');
8+
jest.mock('@src/data/apiHook');
99
jest.mock('react-router', () => ({
1010
useParams: () => ({ courseId: 'test-course-id' }),
1111
}));

src/courseInfo/components/generalCourseInfo/GeneralCourseInfo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Card, Skeleton } from '@openedx/paragon';
22
import { StatusBadge } from './StatusBadge';
3-
import { useCourseInfo } from '../../../data/apiHook';
3+
import { useCourseInfo } from '@src/data/apiHook';
44
import { useParams } from 'react-router';
55
import { FormattedDate, useIntl } from '@openedx/frontend-base';
66
import { useCallback } from 'react';

0 commit comments

Comments
 (0)