vue-instantsearch
Version:
👀 Lightning-fast Algolia search for Vue apps
30 lines (23 loc) • 746 B
JavaScript
import { unescape } from '../unescape';
describe('unescape', () => {
it('unescapes value', () => {
expect(unescape('fred, barney, & pebbles')).toBe(
'fred, barney, & pebbles'
);
expect(unescape('&<>"'/')).toEqual('&<>"\'/');
});
it('handles strings with nothing to unescape', () => {
expect(unescape('abc')).toEqual('abc');
});
it('does not unescape the "`" character', () => {
expect(unescape('`')).toEqual('`');
});
it('does not unescape the "/" character', () => {
expect(unescape('/')).toEqual('/');
});
it('handles strings with tags', () => {
expect(unescape('<mark>TV & Home Theater</mark>')).toBe(
'<mark>TV & Home Theater</mark>'
);
});
});