Skip to content

Commit

Permalink
refactor: fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PKulkoRaccoonGang committed Apr 12, 2024
1 parent c49de51 commit e7d6a92
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/course-unit/CourseUnit.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ describe('<CourseUnit />', () => {
store = initializeStore();
axiosMock = new MockAdapter(getAuthenticatedHttpClient());
axiosMock
.onGet(getCourseUnitApiUrl(courseId))
.onGet(getCourseUnitApiUrl(blockId))
.reply(200, courseUnitIndexMock);
await executeThunk(fetchCourseUnitQuery(courseId), store.dispatch);
await executeThunk(fetchCourseUnitQuery(blockId), store.dispatch);
axiosMock
.onGet(getCourseSectionVerticalApiUrl(blockId))
.reply(200, courseSectionVerticalMock);
Expand Down Expand Up @@ -1095,7 +1095,7 @@ describe('<CourseUnit />', () => {
.reply(200, { dummy: 'value' });
axiosMock
.onGet(getCourseUnitApiUrl(blockId))
.replyOnce(200, {
.reply(200, {
...courseUnitIndexMock,
visibility_state: UNIT_VISIBILITY_STATES.staffOnly,
has_explicit_staff_lock: true,
Expand Down
5 changes: 1 addition & 4 deletions src/course-unit/data/slice.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,7 @@ const slice = createSlice({
};
},
updateLoadingCourseXblockStatus: (state, { payload }) => {
state.loadingStatus = {
...state.loadingStatus,
createUnitXblockLoadingStatus: payload.status,
};
state.createUnitXblockLoadingStatus = payload.status;
},
addNewUnitStatus: (state, { payload }) => {
state.loadingStatus = {
Expand Down

0 comments on commit e7d6a92

Please sign in to comment.