diff options
Diffstat (limited to 'spec/frontend/search/store/getters_spec.js')
-rw-r--r-- | spec/frontend/search/store/getters_spec.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/frontend/search/store/getters_spec.js b/spec/frontend/search/store/getters_spec.js index 571525bd025..8e988ce5c4a 100644 --- a/spec/frontend/search/store/getters_spec.js +++ b/spec/frontend/search/store/getters_spec.js @@ -134,4 +134,23 @@ describe('Global Search Store Getters', () => { ]); }); }); + + describe('unselectedLabels', () => { + it('returns all labels that are not selected', () => { + state.query.labels = ['60']; + expect(getters.unselectedLabels(state)).toStrictEqual([MOCK_LABEL_SEARCH_RESULT]); + }); + }); + + describe('unappliedNewLabels', () => { + it('returns all labels that are selected but not applied', () => { + // Applied labels + state.urlQuery.labels = ['37', '60']; + // Applied and selected labels + state.query.labels = ['37', '6', '73', '60']; + // Selected but unapplied labels + // expect(getters.unappliedNewLabels(state)).toStrictEqual(MOCK_FILTERED_UNSELECTED_LABELS); + expect(getters.unappliedNewLabels(state).map(({ key }) => key)).toStrictEqual(['6', '73']); + }); + }); }); |