Skip to content

Commit

Permalink
fix: tests for age filter and similar events (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
melniiv committed Jan 18, 2023
1 parent 836f23a commit 20362e1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
19 changes: 11 additions & 8 deletions apps/hobbies-helsinki/src/domain/event/queryUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,17 @@ const useSimilarEventsQueryVariables = (event: EventFields) => {
[EVENT_SEARCH_FILTERS.MAX_AGE]: event.audienceMaxAge ?? '',
};

return getEventSearchVariables({
include: ['keywords', 'location'],
// eslint-disable-next-line max-len
pageSize: 100, // TODO: use SIMILAR_EVENTS_AMOUNT when LinkedEvents-query with keyword_OR_set* -param is fixed and it returns distinct results
params: new URLSearchParams(searchParams),
sortOrder: EVENT_SORT_OPTIONS.END_TIME,
superEventType: ['umbrella', 'none'],
});
return {
...getEventSearchVariables({
include: ['keywords', 'location'],
// eslint-disable-next-line max-len
pageSize: 100, // TODO: use SIMILAR_EVENTS_AMOUNT when LinkedEvents-query with keyword_OR_set* -param is fixed and it returns distinct results
params: new URLSearchParams(searchParams),
sortOrder: EVENT_SORT_OPTIONS.END_TIME,
superEventType: ['umbrella', 'none'],
}),
[EVENT_SEARCH_FILTERS.SUITABLE]: [],
};
}, [event]);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ export const getEventSearchVariables = ({
places,
publisher,
text,
suitableFor,
audienceMinAgeLt,
audienceMaxAgeGt,
} = getSearchFilters(params);
Expand Down Expand Up @@ -286,6 +285,8 @@ export const getEventSearchVariables = ({
suitableFor: [Number(audienceMinAgeLt), Number(audienceMaxAgeGt)].filter(
(v) => v
),
audienceMinAgeLt,
audienceMaxAgeGt,
eventType: AppConfig.supportedEventTypes,
};
};
Expand Down

0 comments on commit 20362e1

Please sign in to comment.