debian-mirror-gitlab/spec/frontend/frequent_items/store/getters_spec.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
645 B
JavaScript
Raw Normal View History

2018-11-08 19:23:39 +05:30
import * as getters from '~/frequent_items/store/getters';
2021-03-11 19:13:27 +05:30
import state from '~/frequent_items/store/state';
2018-11-08 19:23:39 +05:30
describe('Frequent Items Dropdown Store Getters', () => {
let mockedState;
beforeEach(() => {
mockedState = state();
});
describe('hasSearchQuery', () => {
it('should return `true` when search query is present', () => {
mockedState.searchQuery = 'test';
expect(getters.hasSearchQuery(mockedState)).toBe(true);
});
it('should return `false` when search query is empty', () => {
mockedState.searchQuery = '';
expect(getters.hasSearchQuery(mockedState)).toBe(false);
});
});
});