mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 18:20:27 +00:00
Replace invalid characters in attribute value; fixes the error
Unescaped '<' not allowed in attributes values
Fixes #2534
16 lines
426 B
JavaScript
16 lines
426 B
JavaScript
import { encodeIdAttribute, decodeIdAttribute } from '../dom-utils';
|
|
|
|
describe('DomUtils', () => {
|
|
describe('encodeIdAttribute/decodeIdAttribute', () => {
|
|
it('encode should be reversible by decode ', () => {
|
|
[
|
|
'123-abc;<foo>',
|
|
';;<<><>',
|
|
'!@#$%^&*()+-\'"',
|
|
].forEach((input) => {
|
|
expect(decodeIdAttribute(encodeIdAttribute(input))).toEqual(input);
|
|
});
|
|
});
|
|
});
|
|
});
|