Skip to content

Commit

Permalink
fix: cleaning unchanged code
Browse files Browse the repository at this point in the history
  • Loading branch information
rpenido committed Jan 2, 2024
1 parent e24a25c commit 996a316
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
3 changes: 2 additions & 1 deletion .tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ host = https://www.transifex.com
file_filter = src/i18n/messages/<lang>.json
source_file = src/i18n/transifex_input.json
source_lang = en
type = KEYVALUEJSON
type = KEYVALUEJSON

29 changes: 14 additions & 15 deletions src/CourseAuthoringRoutes.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,17 @@ import CourseAuthoringRoutes from './CourseAuthoringRoutes';
import initializeStore from './store';

const courseId = 'course-v1:edX+TestX+Test_Course';
const mockCourseId = courseId;
const mockPageAndResourcesText = 'Pages And Resources';
const mockEditorContainerText = 'Editor Container';
const mockVideoSelectorContainerText = 'Video Selector Container';
const mockCustomPagesText = 'Custom Pages';
const pagesAndResourcesMockText = 'Pages And Resources';
const editorContainerMockText = 'Editor Container';
const videoSelectorContainerMockText = 'Video Selector Container';
const customPagesMockText = 'Custom Pages';
let store;
const mockComponentFn = jest.fn();

jest.mock('react-router-dom', () => ({
...jest.requireActual('react-router-dom'),
useParams: () => ({
courseId: mockCourseId,
courseId,
}),
}));

Expand All @@ -34,19 +33,19 @@ jest.mock('@edx/frontend-lib-content-components', () => ({

jest.mock('./pages-and-resources/PagesAndResources', () => (props) => {
mockComponentFn(props);
return mockPageAndResourcesText;
return pagesAndResourcesMockText;
});
jest.mock('./editors/EditorContainer', () => (props) => {
mockComponentFn(props);
return mockEditorContainerText;
return editorContainerMockText;
});
jest.mock('./selectors/VideoSelectorContainer', () => (props) => {
mockComponentFn(props);
return mockVideoSelectorContainerText;
return videoSelectorContainerMockText;
});
jest.mock('./custom-pages/CustomPages', () => (props) => {
mockComponentFn(props);
return mockCustomPagesText;
return customPagesMockText;
});

describe('<CourseAuthoringRoutes>', () => {
Expand All @@ -71,7 +70,7 @@ describe('<CourseAuthoringRoutes>', () => {
</AppProvider>,
);

expect(screen.getByText(mockPageAndResourcesText)).toBeVisible();
expect(screen.getByText(pagesAndResourcesMockText)).toBeVisible();
expect(mockComponentFn).toHaveBeenCalledWith(
expect.objectContaining({
courseId,
Expand All @@ -88,8 +87,8 @@ describe('<CourseAuthoringRoutes>', () => {
</AppProvider>,
);

expect(screen.queryByText(mockEditorContainerText)).toBeInTheDocument();
expect(screen.queryByText(mockPageAndResourcesText)).not.toBeInTheDocument();
expect(screen.queryByText(editorContainerMockText)).toBeInTheDocument();
expect(screen.queryByText(pagesAndResourcesMockText)).not.toBeInTheDocument();
expect(mockComponentFn).toHaveBeenCalledWith(
expect.objectContaining({
courseId,
Expand All @@ -106,8 +105,8 @@ describe('<CourseAuthoringRoutes>', () => {
</AppProvider>,
);

expect(screen.queryByText(mockVideoSelectorContainerText)).toBeInTheDocument();
expect(screen.queryByText(mockPageAndResourcesText)).not.toBeInTheDocument();
expect(screen.queryByText(videoSelectorContainerMockText)).toBeInTheDocument();
expect(screen.queryByText(pagesAndResourcesMockText)).not.toBeInTheDocument();
expect(mockComponentFn).toHaveBeenCalledWith(
expect.objectContaining({
courseId,
Expand Down

0 comments on commit 996a316

Please sign in to comment.