Welcome to mirror list, hosted at ThFree Co, Russian Federation.

utils_spec.js « users_select « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7a080ddaf0f7d4232b36ca3ab2c1b907ed764127 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { getAjaxUsersSelectParams } from '~/users_select/utils';

const options = {
  fooBar: 'baz',
  activeUserId: 1,
};

describe('getAjaxUsersSelectParams', () => {
  it('returns query parameters built from provided options', () => {
    expect(
      getAjaxUsersSelectParams(options, {
        foo_bar: 'fooBar',
        active_user_id: 'activeUserId',
        non_existent_key: 'nonExistentKey',
      }),
    ).toEqual({
      foo_bar: 'baz',
      active_user_id: 1,
      non_existent_key: null,
    });
  });
});