sanitizeQuerySelector.spec.jsx 539 B

123456789101112131415
  1. import {sanitizeQuerySelector} from 'sentry/utils/sanitizeQuerySelector';
  2. describe('sanitizeQuerySelector', function () {
  3. it('replaces all spaces with a hyphen', function () {
  4. expect(sanitizeQuerySelector('foo bar baz bar foo')).toBe('foo-bar-baz-bar-foo');
  5. });
  6. it('replaces colons with a hyphen', function () {
  7. expect(sanitizeQuerySelector('foo:bar:baz bar foo')).toBe('foo-bar-baz-bar-foo');
  8. });
  9. it('returns an empty string if passed undefined', function () {
  10. expect(sanitizeQuerySelector()).toBe('');
  11. });
  12. });