summaryrefslogtreecommitdiff
path: root/spec/frontend/work_items_hierarchy/hierarchy_util_spec.js
blob: 9042fa27d16708ddf07d28cf2671199e9ae51206 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { inferLicensePlan } from '~/work_items_hierarchy/hierarchy_util';
import { LICENSE_PLAN } from '~/work_items_hierarchy/constants';

describe('inferLicensePlan', () => {
  it.each`
    epics    | subEpics | licensePlan
    ${true}  | ${true}  | ${LICENSE_PLAN.ULTIMATE}
    ${true}  | ${false} | ${LICENSE_PLAN.PREMIUM}
    ${false} | ${false} | ${LICENSE_PLAN.FREE}
  `(
    'returns $licensePlan when epic is $epics and sub-epic is $subEpics',
    ({ epics, subEpics, licensePlan }) => {
      expect(inferLicensePlan({ hasEpics: epics, hasSubEpics: subEpics })).toBe(licensePlan);
    },
  );
});