react-loading-progress
Version:
Loading display components
17 lines (13 loc) • 460 B
JavaScript
// @flow
import escape from '../escape'
describe('escape', () => {
it('replaces characters that could be part of CSS selectors', () => {
expect(escape('foo(bar):#*$><+~=|^baz')).toEqual('foo-bar-baz')
})
it('replaces double hyphens with a single hyphen', () => {
expect(escape('foo--bar')).toEqual('foo-bar')
})
it('removes extraneous hyphens at the ends of the string', () => {
expect(escape('-foo--bar-')).toEqual('foo-bar')
})
})