summaryrefslogtreecommitdiff
path: root/spec/javascripts/boards/utils/query_data_spec.js
blob: 922215ffc1d215af4ffb9caca5c65b52d2d70ff4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import queryData from '~/boards/utils/query_data';

describe('queryData', () => {
  it('parses path for label with trailing +', () => {
    expect(
      queryData('label_name[]=label%2B', {}),
    ).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',
    });
  });
});