import { prettifySVG } from '../lib/svg/pretty';
describe('Prettify SVG', () => {
test('Basic XML', () => {
expect(
prettifySVG(
''
)
).toBe(
'\n'
);
// Self closing tag
expect(
prettifySVG(
''
)
).toBe(
'\n'
);
// With xml tag
expect(
prettifySVG(
'\n\n\t'
)
).toBe(
'\n\n'
);
});
test('Text', () => {
expect(prettifySVG('')).toBe(
'\n'
);
expect(
prettifySVG('')
).toBe('\n');
expect(
prettifySVG('')
).toBe('\n');
expect(prettifySVG('')).toBe(
'\n'
);
});
test('Style and script', () => {
// Basic CSS
expect(
prettifySVG('')
).toBe('\n');
// Basic script
expect(
prettifySVG(
''
)
).toBe(
'\n'
);
// Selector with '>' and tag after that
expect(
prettifySVG(
''
)
).toBe(
'\n'
);
});
test('Bad code', () => {
expect(prettifySVG('