Skip to content

Commit

Permalink
Fixing Tests due to iconset structure changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleynolan committed Feb 5, 2020
1 parent 11ec948 commit 38601c9
Show file tree
Hide file tree
Showing 6 changed files with 312 additions and 113 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@
"core-js": "3.1.3"
},
"devDependencies": {
"@justeat/browserslist-config-fozzie": "^1.1.1",
"@justeat/eslint-config-fozzie": "^3.0.0",
"@justeat/browserslist-config-fozzie": "1.1.1",
"@justeat/eslint-config-fozzie": "3.4.0",
"babel-cli": "6.24.1",
"babel-loader": "7.1.1",
"babel-preset-env": "1.7.0",
"babel-preset-stage-2": "6.24.1",
"cheerio": "1.0.0-rc.2",
"danger": "8.0.0",
"eslint": "6.2.2",
"eslint-plugin-import": "^2.18.2",
"eslint": "6.8.0",
"eslint-plugin-import": "^2.20.1",
"html-minifier": "3.5.8",
"husky": "0.14.3",
"jest": "22.4.4",
Expand Down
5 changes: 3 additions & 2 deletions src/__tests__/icon.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ import Icon from '../icon';
const icon1 = new Icon(
'test',
'<line x1="23" y1="1" x2="1" y2="23" /><line x1="1" y1="1" x2="23" y2="23" />',
['hello', 'world', 'foo', 'bar'],
'',
['hello', 'world', 'foo', 'bar']
);

const icon2 = new Icon(
'test',
'<line x1="23" y1="1" x2="1" y2="23" /><line x1="1" y1="1" x2="23" y2="23" />',
'<line x1="23" y1="1" x2="1" y2="23" /><line x1="1" y1="1" x2="23" y2="23" />'
);

test('constructs icon object correctly', () => {
Expand Down
9 changes: 6 additions & 3 deletions src/__tests__/icons.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
import icons from '../icons';

jest.mock('../../dist/icons.json', () => ({
icon1:
'<line x1="23" y1="1" x2="1" y2="23" /><line x1="1" y1="1" x2="23" y2="23" />',
icon2: '<circle cx="12" cy="12" r="11" />'
icon1: {
contents: '<line x1="23" y1="1" x2="1" y2="23" /><line x1="1" y1="1" x2="23" y2="23" />'
},
icon2: {
contents: '<circle cx="12" cy="12" r="11" />'
}
}));

jest.mock('../tags.json', () => ({
Expand Down
9 changes: 6 additions & 3 deletions src/__tests__/replace.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
import replace from '../replace';

jest.mock('../../dist/icons.json', () => ({
icon1:
'<line x1="23" y1="1" x2="1" y2="23" /><line x1="1" y1="1" x2="23" y2="23" />',
icon2: '<circle cx="12" cy="12" r="11" />'
icon1: {
contents: '<line x1="23" y1="1" x2="1" y2="23" /><line x1="1" y1="1" x2="23" y2="23" />'
},
icon2: {
contents: '<circle cx="12" cy="12" r="11" />'
}
}));

test('replaces [data-ficons] elements with SVG markup', () => {
Expand Down
5 changes: 3 additions & 2 deletions src/__tests__/to-svg.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
import toSvg from '../to-svg';

jest.mock('../../dist/icons.json', () => ({
icon1:
'<line x1="23" y1="1" x2="1" y2="23" /><line x1="1" y1="1" x2="23" y2="23" />'
icon1: {
contents: '<line x1="23" y1="1" x2="1" y2="23" /><line x1="1" y1="1" x2="23" y2="23" />'
}
}));

test('returns correct string', () => {
Expand Down
Loading

0 comments on commit 38601c9

Please sign in to comment.