summaryrefslogtreecommitdiff
path: root/spec/frontend/admin/abuse_reports/utils_spec.js
blob: 17f0b9acb26239c8c9e98de28a82a34fed8e325f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
import { FILTERED_SEARCH_TOKEN_CATEGORY } from '~/admin/abuse_reports/constants';
import { buildFilteredSearchCategoryToken } from '~/admin/abuse_reports/utils';

describe('buildFilteredSearchCategoryToken', () => {
  it('adds correctly formatted options to FILTERED_SEARCH_TOKEN_CATEGORY', () => {
    const categories = ['tuxedo', 'tabby'];

    expect(buildFilteredSearchCategoryToken(categories)).toMatchObject({
      ...FILTERED_SEARCH_TOKEN_CATEGORY,
      options: categories.map((c) => ({ value: c, title: c })),
    });
  });
});