Skip to content

Commit

Permalink
chore: rename test files to .svg.txt (#1937)
Browse files Browse the repository at this point in the history
  • Loading branch information
SethFalco committed Jan 17, 2024
1 parent 174e952 commit d7a851f
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions test/svgo/_index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ const parseFixture = async (file) => {

describe('svgo', () => {
it('should create indent with 2 spaces', async () => {
const [original, expected] = await parseFixture('test.svg');
const [original, expected] = await parseFixture('test.svg.txt');
const result = optimize(original, {
plugins: [],
js2svg: { pretty: true, indent: 2 },
});
expect(normalize(result.data)).toStrictEqual(expected);
});
it('should handle plugins order properly', async () => {
const [original, expected] = await parseFixture('plugins-order.svg');
const [original, expected] = await parseFixture('plugins-order.svg.txt');
const result = optimize(original, { path: 'input.svg' });
expect(normalize(result.data)).toStrictEqual(expected);
});
Expand All @@ -37,15 +37,17 @@ describe('svgo', () => {
expect(result.data).toBe('<svg/>');
});
it('should preserve style specificity over attributes', async () => {
const [original, expected] = await parseFixture('style-specificity.svg');
const [original, expected] = await parseFixture(
'style-specificity.svg.txt',
);
const result = optimize(original, {
path: 'input.svg',
js2svg: { pretty: true },
});
expect(normalize(result.data)).toStrictEqual(expected);
});
it('should inline entities', async () => {
const [original, expected] = await parseFixture('entities.svg');
const [original, expected] = await parseFixture('entities.svg.txt');
const result = optimize(original, {
path: 'input.svg',
plugins: [],
Expand All @@ -54,30 +56,34 @@ describe('svgo', () => {
expect(normalize(result.data)).toStrictEqual(expected);
});
it('should preserve whitespaces between tspan tags', async () => {
const [original, expected] = await parseFixture('whitespaces.svg');
const [original, expected] = await parseFixture('whitespaces.svg.txt');
const result = optimize(original, {
path: 'input.svg',
js2svg: { pretty: true },
});
expect(normalize(result.data)).toStrictEqual(expected);
});
it('should preserve "to" keyframe selector', async () => {
const [original, expected] = await parseFixture('keyframe-selectors.svg');
const [original, expected] = await parseFixture(
'keyframe-selectors.svg.txt',
);
const result = optimize(original, {
path: 'input.svg',
js2svg: { pretty: true },
});
expect(normalize(result.data)).toStrictEqual(expected);
});
it('should not trim whitespace at start and end of pre element', async () => {
const [original, expected] = await parseFixture('pre-element.svg');
const [original, expected] = await parseFixture('pre-element.svg.txt');
const result = optimize(original, {
path: 'input.svg',
});
expect(normalize(result.data)).toStrictEqual(expected);
});
it('should not add whitespace in pre element', async () => {
const [original, expected] = await parseFixture('pre-element-pretty.svg');
const [original, expected] = await parseFixture(
'pre-element-pretty.svg.txt',
);
const result = optimize(original, {
path: 'input.svg',
js2svg: { pretty: true },
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit d7a851f

Please sign in to comment.