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

get_safe_branch_name_helper_spec.js « helpers « repo « javascripts « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f426227fa602a0c7020ff484d0666f1bb66f298b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
import getSafeBranchName from '~/repo/helpers/get_safe_branch_name_helper';

describe('getSafeBranchName', () => {
  it('does not replace repeated dashes with single dashes', () => {
    const branch = 'some--branch--name';
    expect(getSafeBranchName(branch)).toBe(branch);
  });

  it('removes non-alphanumeric characters', () => {
    const branch = '$some#-branch!';
    expect(getSafeBranchName(branch)).toBe('some-branch');
  });
});