debian-mirror-gitlab/spec/frontend/frequent_items/store/getters_spec.js
2019-05-18 00:54:41 +05:30

24 lines
645 B
JavaScript

import state from '~/frequent_items/store/state';
import * as getters from '~/frequent_items/store/getters';
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);
});
});
});