gitlab-org--gitlab-foss/spec/javascripts/boards/utils/query_data_spec.js
2018-01-18 00:14:51 +11:00

28 lines
624 B
JavaScript

import queryData from '~/boards/utils/query_data';
describe('queryData', () => {
it('parses path for label with trailing +', () => {
const path = 'label_name[]=label%2B';
expect(
queryData(path, {}),
).toEqual({
label_name: ['label+'],
});
});
it('parses path for milestone with trailing +', () => {
expect(
queryData('milestone_title=A%2B', {}),
).toEqual({
milestone_title: 'A+',
});
});
it('parses path for search terms with spaces', () => {
expect(
queryData('search=two+words', {}),
).toEqual({
search: 'two words',
});
});
});