2018-07-06 09:40:11 -04:00
|
|
|
import * as getters from '~/frequent_items/store/getters';
|
2021-02-14 13:09:20 -05:00
|
|
|
import state from '~/frequent_items/store/state';
|
2018-07-06 09:40:11 -04:00
|
|
|
|
|
|
|
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);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|