mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
28 lines
769 B
TypeScript
28 lines
769 B
TypeScript
import slugify from 'sentry/utils/slugify';
|
|
|
|
describe('slugify', function () {
|
|
it('forces to lowercase', function () {
|
|
expect(slugify('STOPYELLING')).toBe('stopyelling');
|
|
});
|
|
|
|
it('replaces spaces with a hyphen', function () {
|
|
expect(slugify('STOP YELLING')).toBe('stop-yelling');
|
|
});
|
|
|
|
it('replaces accented characters', function () {
|
|
expect(slugify('Áá')).toBe('aa');
|
|
});
|
|
|
|
it('splits ligatures', function () {
|
|
expect(slugify('fi')).toBe('fi');
|
|
});
|
|
|
|
it('Removes special characters', function () {
|
|
expect(slugify("some#chars%shouldn't*be.here")).toBe('somecharsshouldntbehere');
|
|
});
|
|
|
|
it('keeps hyphens and underscores', function () {
|
|
expect(slugify('_some-chars__should-stay')).toBe('_some-chars__should-stay');
|
|
});
|
|
});
|