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

utils_spec.js « command_palette « global_search « components « super_sidebar « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0b75787723e5b266901e55f9f8bcdf6cc66ef951 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import {
  commandMapper,
  linksReducer,
} from '~/super_sidebar/components/global_search/command_palette/utils';
import { COMMANDS, LINKS, TRANSFORMED_LINKS } from './mock_data';

describe('linksReducer', () => {
  it('should transform links', () => {
    expect(LINKS.reduce(linksReducer, [])).toEqual(TRANSFORMED_LINKS);
  });
});

describe('commandMapper', () => {
  it('should temporarily remove the `invite_members` item', () => {
    const initialCommandsLength = COMMANDS[0].items.length;
    expect(COMMANDS.map(commandMapper)[0].items).toHaveLength(initialCommandsLength - 1);
  });
});