Skip to content

Commit

Permalink
test: adds showHidden test
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosMealha committed Jan 24, 2023
1 parent 04a1c18 commit 598f1ae
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/actions/searchOffersActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => ({
Expand Down
16 changes: 15 additions & 1 deletion src/reducers/searchOffersReducer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
disableOffer,
companyEnableOffer,
adminEnableOffer,
setShowHidden,
} from "../actions/searchOffersActions";

describe("Search Offers Reducer", () => {
Expand All @@ -26,8 +27,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", () => {
Expand Down Expand Up @@ -111,6 +114,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(
{
Expand Down

0 comments on commit 598f1ae

Please sign in to comment.