diff --git a/src/actions/searchOffersActions.js b/src/actions/searchOffersActions.js index 6cce5f3e..2003e4eb 100644 --- a/src/actions/searchOffersActions.js +++ b/src/actions/searchOffersActions.js @@ -100,6 +100,7 @@ export const resetAdvancedSearchFields = () => (dispatch) => { dispatch(setJobDuration(INITIAL_JOB_DURATION, INITIAL_JOB_DURATION + 1)); dispatch(setFields([])); dispatch(setTechs([])); + dispatch(setShowHidden(false)); }; export const setShowHidden = (showHidden) => ({ diff --git a/src/reducers/searchOffersReducer.spec.js b/src/reducers/searchOffersReducer.spec.js index f213ae62..aa5effd7 100644 --- a/src/reducers/searchOffersReducer.spec.js +++ b/src/reducers/searchOffersReducer.spec.js @@ -14,11 +14,13 @@ import { disableOffer, companyEnableOffer, adminEnableOffer, + setShowHidden, } from "../actions/searchOffersActions"; describe("Search Offers Reducer", () => { it("should correctly initialize search offers state", () => { const state = searchOffersState(undefined, {}); + console.log(state); expect(state).toEqual({ searchValue: "", jobType: INITIAL_JOB_TYPE, jobDuration: [null, null], @@ -26,8 +28,10 @@ describe("Search Offers Reducer", () => { offers: [], fields: [], technologies: [], + showHidden: false, loading: false, - error: null }); + error: null, + }); }); it("should set offers when setSearchOffers action is called", () => { @@ -111,6 +115,17 @@ describe("Search Offers Reducer", () => { expect(state.fields).toStrictEqual(["test1", "test2"]); }); + it("should set advanced search fields when setShowHidden action is called", () => { + const state = searchOffersState( + { + showHidden: false, + }, + setShowHidden(true) + ); + + expect(state.showHidden).toBe(true); + }); + it("should set advanced search technologies when setTechs action is called", () => { const state = searchOffersState( {