mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-18 06:22:28 +03:00
Add some basic test cases for normalizeBranchName
This commit is contained in:
parent
63ee99b647
commit
32a8992af6
16
app/src/lib/utils/branch.test.ts
Normal file
16
app/src/lib/utils/branch.test.ts
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import { normalizeBranchName } from '$lib/utils/branch';
|
||||||
|
import { describe, expect, test } from 'vitest';
|
||||||
|
|
||||||
|
describe.concurrent('normalizeBranchName', () => {
|
||||||
|
test('it should remove undesirable symbols', () => {
|
||||||
|
expect(normalizeBranchName('a£^&*() b')).toEqual('a-b');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('it should preserve capital letters', () => {
|
||||||
|
expect(normalizeBranchName('Hello World')).toEqual('Hello-World');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('it should preserve `#`, `_`, `/`, and `.`', () => {
|
||||||
|
expect(normalizeBranchName('hello#_./world')).toEqual('hello#_./world');
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user