Skip to content

Commit

Permalink
test: --icon should add missing width and height
Browse files Browse the repository at this point in the history
  • Loading branch information
tomchentw committed Jan 21, 2018
1 parent 2eacfd8 commit cd21b43
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
20 changes: 20 additions & 0 deletions __fixtures__/two.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions src/cli/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@ export default One;
"
`;

exports[`cli --icon 2`] = `
"import React from \\"react\\";
const Two = props => (
<svg viewBox=\\"0 0 48 1\\" width=\\"1em\\" height=\\"1em\\" {...props}>
<path d=\\"M0 0h48v1H0z\\" fill=\\"#063855\\" fillRule=\\"evenodd\\" />
</svg>
);
export default Two;
"
`;

exports[`cli --ids 1`] = `
"import React from \\"react\\";
Expand Down
2 changes: 2 additions & 0 deletions src/cli/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ describe('cli', () => {
it('--icon', async () => {
const [stdout] = await exec('bin/svgr --icon __fixtures__/one.svg')
expect(stdout).toMatchSnapshot()
const [stdout2] = await exec('bin/svgr --icon __fixtures__/two.svg')
expect(stdout2).toMatchSnapshot()
})

it('--ref', async () => {
Expand Down

0 comments on commit cd21b43

Please sign in to comment.