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

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

describe('Packages shared utils', () => {
  describe('getPackageTypeLabel', () => {
    describe.each`
      packageType   | expectedResult
      ${'CONAN'}    | ${'Conan'}
      ${'MAVEN'}    | ${'Maven'}
      ${'NPM'}      | ${'npm'}
      ${'NUGET'}    | ${'NuGet'}
      ${'PYPI'}     | ${'PyPI'}
      ${'RUBYGEMS'} | ${'RubyGems'}
      ${'COMPOSER'} | ${'Composer'}
      ${'DEBIAN'}   | ${'Debian'}
      ${'HELM'}     | ${'Helm'}
      ${'FOO'}      | ${null}
    `(`package type`, ({ packageType, expectedResult }) => {
      it(`${packageType} should show as ${expectedResult}`, () => {
        expect(getPackageTypeLabel(packageType)).toBe(expectedResult);
      });
    });
  });
});