slugify.spec.tsx 553 B

12345678910111213141516171819
  1. import slugify from 'sentry/utils/slugify';
  2. describe('slugify', function () {
  3. it('forces to lowercase', function () {
  4. expect(slugify('STOPYELLING')).toBe('stopyelling');
  5. });
  6. it('replaces spaces with a hyphen', function () {
  7. expect(slugify('STOP YELLING')).toBe('stop-yelling');
  8. });
  9. it('does not replace other special characters', function () {
  10. expect(slugify('STOP YELLING!@#')).toBe('stop-yelling!@#');
  11. });
  12. it('returns an empty string if passed undefined', function () {
  13. expect(slugify(undefined)).toBe('');
  14. });
  15. });