1
0
Fork 0

white_check_mark: Added tests and upgraded babel

This commit is contained in:
joostdecock 2018-09-26 12:09:25 +00:00 committed by Joost De Cock
parent 4d3ca4965e
commit 2b455ccd46
16 changed files with 4702 additions and 1164 deletions

View file

@ -0,0 +1,10 @@
{
"presets": [
[
"@babel/preset-env",
{
"useBuiltIns": "entry"
}
]
]
}

File diff suppressed because it is too large Load diff

View file

@ -26,13 +26,16 @@
"minor": "npm version minor -m ':bookmark: v%s' && npm run build",
"major": "npm version major -m ':bookmark: v%s' && npm run build",
"precommit": "npm run pretty && lint-staged",
"test": "echo 'Error: no test specified' && exit 1",
"css": "uglifycss src/lib/base.css > src/lib/base.min.css && echo 'export default `'> src/lib/base.css.js && cat src/lib/base.min.css >> src/lib/base.css.js && echo '`;' >> src/lib/base.css.js",
"test": "nyc mocha --require @babel/register tests/*.test.js",
"report": "nyc report --reporter=html mocha --require @babel/register tests/*.test.js",
"coverage": "nyc npm test && nyc report --reporter=text-lcov > coverage.lcov && ./node_modules/.bin/codecov",
"clean": "rimraf dist",
"pretty": "npx prettier --write 'src/*.js'",
"lint": "eslint --fix 'src/*.js'",
"browserbuild": "rollup -c rollup.js --file dist/browser.js --format iife --name freesewing.plugins.theme",
"nodebuild": "rollup -c rollup.js --file dist/index.js --format cjs",
"modulebuild": "rollup -c rollup.js --file dist/index.mjs --format es",
"browserbuild": "rollup -c rollup.js --file dist/browser.js --format iife -m true --name freesewing.plugins.theme",
"nodebuild": "rollup -c rollup.js --file dist/index.js --format cjs -m true",
"modulebuild": "rollup -c rollup.js --file dist/index.mjs --format es -m true",
"build": "npm run clean && npm run browserbuild && npm run nodebuild && npm run modulebuild"
},
"husky": {
@ -47,21 +50,30 @@
]
},
"devDependencies": {
"babel-core": "^6.26.3",
"babel-eslint": "^8.2.6",
"@babel/core": "^7.1.0",
"@babel/preset-env": "^7.1.0",
"@babel/register": "^7.0.0",
"chai": "^4.1.2",
"chai-string": "1.4.0",
"codecov": "^3.1.0",
"eslint": "^5.2.0",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-prettier": "^2.6.2",
"freesewing": "^0.18.3",
"husky": "^0.14.3",
"lint-staged": "^7.2.0",
"mocha": "^5.2.0",
"nyc": "12.0.2",
"prettier": "^1.13.7",
"rimraf": "^2.6.2",
"rollup-plugin-babel": "^3.0.7",
"rollup": "^0.66.2",
"rollup-plugin-babel": "^4.0.3",
"rollup-plugin-commonjs": "^9.1.3",
"rollup-plugin-filesize": "^4.0.1",
"rollup-plugin-json": "^3.0.0",
"rollup-plugin-node-resolve": "^3.3.0",
"rollup-plugin-terser": "^1.0.1"
"rollup-plugin-terser": "^1.0.1",
"uglifycss": "0.0.29"
},
"files": [
"dist/*",

View file

@ -13,11 +13,11 @@ export default {
json(),
babel({
exclude: "node_modules/**"
}),
terser({
output: {
preamble: `/**\n * ${name} | v${version}\n * ${description}\n * (c) ${new Date().getFullYear()} ${author}\n * @license ${license}\n */`
}
})
//terser({
// output: {
// preamble: `/**\n * ${name} | v${version}\n * ${description}\n * (c) ${new Date().getFullYear()} ${author}\n * @license ${license}\n */`
// }
//})
]
};

View file

@ -1,7 +1,4 @@
import baseCss from "./lib/base.css.js";
import draftCss from "./lib/draft.css.js";
import sampleCss from "./lib/sample.css.js";
import paperlessCss from "./lib/paperless.css.js";
import notch from "./lib/notch";
import gridMetric from "./lib/grid-metric";
import gridImperial from "./lib/grid-imperial";
@ -15,10 +12,7 @@ export default {
this.style += baseCss;
this.defs += notch;
this.attributes.add("freesewing:plugin-theme", version);
if (this.pattern.settings.mode === "sample") this.style += sampleCss;
else this.style += draftCss;
if (this.pattern.settings.paperless) {
this.style += paperlessCss;
if (this.pattern.settings.units === "imperial")
this.defs += gridImperial;
else this.defs += gridMetric;
@ -30,8 +24,9 @@ export default {
anchor = part.points.gridAnchor;
else if (typeof part.points.anchor !== "undefined")
anchor = part.points.anchor;
this.defs += `<pattern id="grid_${key}"
xlink:href="#grid" x="${anchor.x}" y="${anchor.y}"></pattern>`;
this.defs += `<pattern id="grid_${key}" `;
this.defs += `xlink:href="#grid" x="${anchor.x}" y="${anchor.y}">`;
this.defs += "</pattern>";
part.paths[part.getId()] = new this.pattern.Path()
.move(part.topLeft)
.line(new this.pattern.Point(part.topLeft.x, part.bottomRight.y))

View file

@ -1,4 +1,121 @@
/* Reset */
path,circle,rect{fill:none;stroke:none}
path,circle{stroke:#000;stroke-opacity:1;stroke-width:.3;stroke-linecap:round;stroke-linejoin:round}
text{font-size:5px;font-family:-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;fill:#000;text-anchor:start;font-weight:200;dominant-baseline:ideographic;}
/* Defaults */
path,circle{
stroke:#000;
stroke-opacity:1;
stroke-width:.3;
stroke-linecap:round;
stroke-linejoin:round;
}
/* Stroke classes */
.fabric{
stroke-width:.6;
stroke:#212121
}
.lining{
stroke-width:.6;
stroke:#ff5b77;
}
.interfacing{
stroke-width:.6;
stroke:#64b5f6;
}
.canvas{
stroke-width:.6;
stroke:#ff9000;
}
.various{
stroke-width:.6;
stroke:#4caf50;
}
.note{
stroke-width:.4;
stroke:#dd60dd;
}
.mark{
stroke-width:.4;
stroke:blue;
}
.contrast{
stroke-width:.8;
stroke:red;
}
.stroke-xs{ stroke-width:.1; }
.stroke-sm{ stroke-width:.2; }
.stroke-lg{ stroke-width:.6; }
.stroke-xl{ stroke-width:1; }
.stroke-xxl{ stroke-width:2; }
.sa { stroke-dasharray:0.4,0.8; }
.help {
stroke-width:.2;
stroke-dasharray:15,1.5,1,1.5;
}
.dotted { stroke-dasharray:0.4,0.8; }
.dashed { stroke-dasharray:1,1.5; }
.lashed { stroke-dasharray:6,6; }
.hidden {
stroke:none;
fill:none;
}
/* Fill classes */
.fill-fabric{ fill:#212121; }
.fill-lining{ fill:#ff5b77; }
.fill-interfacing{ fill:#64b5f6; }
.fill-canvas{ fill:#ff9000; }
.fill-various{ fill:#4caf50; }
.fill-note{ fill:#dd69dd; }
.fill-mark{ fill:blue; }
.fill-contrast{ fill:red; }
/* Text */
text{
font-size:5px;
font-family:-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
fill:#000;
text-anchor:start;
font-weight:200;
dominant-baseline:ideographic;
}
.text-xs { font-size:3px; }
.text-sm { font-size:4px; }
.text-lg { font-size:7px; }
.text-xl { font-size:9px; }
.text-xxl{ font-size:12px; }
.center{ text-anchor:middle; }
.right{ text-anchor:end; }
/* Paperless grid */
path.grid {
fill: none;
stroke: #555;
stroke-width: 0.3;
}
path.gridline {
stroke: #555;
stroke-width: 0.2;
}
path.gridline-lg {
stroke: #777;
stroke-width: 0.2;
stroke-dasharray: 1.5,1.5;
}
path.gridline-sm {
stroke: #999;
stroke-width: 0.1;
}
path.gridline-xs {
stroke: #999;
stroke-width: 0.1;
stroke-dasharray: 0.5,0.5;
}
path.gridbox{ fill: url(#grid); }
/* Sample classes */
path.sample {stroke-width: 0.75}
path.sample-focus {stroke-width: 1.5; fill: rgba(0,0,0,0.1)}

View file

@ -1 +1,3 @@
export default `path,circle,rect{fill:none;stroke:none}path,circle{stroke:#000;stroke-opacity:1;stroke-width:.3;stroke-linecap:round;stroke-linejoin:round}text{font-size:5px;font-family:-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;fill:#000;text-anchor:start;font-weight:200;dominant-baseline:ideographic}`;
export default `
path,circle,rect{fill:none;stroke:none}path,circle{stroke:#000;stroke-opacity:1;stroke-width:.3;stroke-linecap:round;stroke-linejoin:round}.fabric{stroke-width:.6;stroke:#212121}.lining{stroke-width:.6;stroke:#ff5b77}.interfacing{stroke-width:.6;stroke:#64b5f6}.canvas{stroke-width:.6;stroke:#ff9000}.various{stroke-width:.6;stroke:#4caf50}.note{stroke-width:.4;stroke:#dd60dd}.mark{stroke-width:.4;stroke:blue}.contrast{stroke-width:.8;stroke:red}.stroke-xs{stroke-width:.1}.stroke-sm{stroke-width:.2}.stroke-lg{stroke-width:.6}.stroke-xl{stroke-width:1}.stroke-xxl{stroke-width:2}.sa{stroke-dasharray:.4,0.8}.help{stroke-width:.2;stroke-dasharray:15,1.5,1,1.5}.dotted{stroke-dasharray:.4,0.8}.dashed{stroke-dasharray:1,1.5}.lashed{stroke-dasharray:6,6}.hidden{stroke:none;fill:none}.fill-fabric{fill:#212121}.fill-lining{fill:#ff5b77}.fill-interfacing{fill:#64b5f6}.fill-canvas{fill:#ff9000}.fill-various{fill:#4caf50}.fill-note{fill:#dd69dd}.fill-mark{fill:blue}.fill-contrast{fill:red}text{font-size:5px;font-family:-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;fill:#000;text-anchor:start;font-weight:200;dominant-baseline:ideographic}.text-xs{font-size:3px}.text-sm{font-size:4px}.text-lg{font-size:7px}.text-xl{font-size:9px}.text-xxl{font-size:12px}.center{text-anchor:middle}.right{text-anchor:end}path.grid{fill:none;stroke:#555;stroke-width:.3}path.gridline{stroke:#555;stroke-width:.2}path.gridline-lg{stroke:#777;stroke-width:.2;stroke-dasharray:1.5,1.5}path.gridline-sm{stroke:#999;stroke-width:.1}path.gridline-xs{stroke:#999;stroke-width:.1;stroke-dasharray:.5,0.5}path.gridbox{fill:url(#grid)}path.sample{stroke-width:.75}path.sample-focus{stroke-width:1.5;fill:rgba(0,0,0,0.1)}
`;

View file

@ -0,0 +1 @@
path,circle,rect{fill:none;stroke:none}path,circle{stroke:#000;stroke-opacity:1;stroke-width:.3;stroke-linecap:round;stroke-linejoin:round}.fabric{stroke-width:.6;stroke:#212121}.lining{stroke-width:.6;stroke:#ff5b77}.interfacing{stroke-width:.6;stroke:#64b5f6}.canvas{stroke-width:.6;stroke:#ff9000}.various{stroke-width:.6;stroke:#4caf50}.note{stroke-width:.4;stroke:#dd60dd}.mark{stroke-width:.4;stroke:blue}.contrast{stroke-width:.8;stroke:red}.stroke-xs{stroke-width:.1}.stroke-sm{stroke-width:.2}.stroke-lg{stroke-width:.6}.stroke-xl{stroke-width:1}.stroke-xxl{stroke-width:2}.sa{stroke-dasharray:.4,0.8}.help{stroke-width:.2;stroke-dasharray:15,1.5,1,1.5}.dotted{stroke-dasharray:.4,0.8}.dashed{stroke-dasharray:1,1.5}.lashed{stroke-dasharray:6,6}.hidden{stroke:none;fill:none}.fill-fabric{fill:#212121}.fill-lining{fill:#ff5b77}.fill-interfacing{fill:#64b5f6}.fill-canvas{fill:#ff9000}.fill-various{fill:#4caf50}.fill-note{fill:#dd69dd}.fill-mark{fill:blue}.fill-contrast{fill:red}text{font-size:5px;font-family:-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;fill:#000;text-anchor:start;font-weight:200;dominant-baseline:ideographic}.text-xs{font-size:3px}.text-sm{font-size:4px}.text-lg{font-size:7px}.text-xl{font-size:9px}.text-xxl{font-size:12px}.center{text-anchor:middle}.right{text-anchor:end}path.grid{fill:none;stroke:#555;stroke-width:.3}path.gridline{stroke:#555;stroke-width:.2}path.gridline-lg{stroke:#777;stroke-width:.2;stroke-dasharray:1.5,1.5}path.gridline-sm{stroke:#999;stroke-width:.1}path.gridline-xs{stroke:#999;stroke-width:.1;stroke-dasharray:.5,0.5}path.gridbox{fill:url(#grid)}path.sample{stroke-width:.75}path.sample-focus{stroke-width:1.5;fill:rgba(0,0,0,0.1)}

View file

@ -1,48 +0,0 @@
path,circle,rect{fill:none;stroke:none}
path{stroke:#000;stroke-opacity:1;stroke-width:.3;stroke-linecap:round;stroke-linejoin:round}
.fabric{stroke-width:.6;stroke:#212121}
.lining{stroke-width:.6;stroke:#ff5b77}
.interfacing{stroke-width:.6;stroke:#64b5f6}
.canvas{stroke-width:.6;stroke:#ff9000}
.various{stroke-width:.6;stroke:#4caf50}
.note{stroke-width:.4;stroke:#dd60dd}
.mark{stroke-width:.4;stroke:blue}
.contrast{stroke-width:.8;stroke:red}
.fill-fabric{fill:#212121}
.fill-lining{fill:#ff5b77}
.fill-interfacing{fill:#64b5f6}
.fill-canvas{fill:#ff9000}
.fill-various{fill:#4caf50}
.fill-note{fill:#dd69dd}
.fill-mark{fill:blue}
.fill-contrast{fill:red}
text{font-size:5px;font-family:-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;fill:#000;text-anchor:start;font-weight:200;dominant-baseline:ideographic;}
.text-xs{font-size:3px}
.text-sm{font-size:4px}
.text-lg{font-size:7px}
.text-xl{font-size:9px}
.text-xxl{font-size:12px}
.center{text-anchor:middle}
.right{text-anchor:end}
.stroke-xs{stroke-width:.1}
.stroke-sm{stroke-width:.2}
.stroke-lg{stroke-width:.6}
.stroke-xl{stroke-width:1}
.stroke-xxl{stroke-width:2}
.sa{stroke-dasharray:0.4,0.8}
.help{stroke-width:.2;stroke-dasharray:15,1.5,1,1.5}
.dotted{stroke-dasharray:0.4,0.8}
.dashed{stroke-dasharray:1,1.5}
.lashed{stroke-dasharray:6,6}
.hidden{stroke:none;fill:none}
path.grid { fill: none; stroke: #555; stroke-width: 0.3; }
path.gridline { stroke: #555; stroke-width: 0.2; }
path.gridline-lg { stroke: #777; stroke-width: 0.2; stroke-dasharray: 1.5,1.5; }
path.gridline-sm { stroke: #999; stroke-width: 0.1; }
path.gridline-xs { stroke: #999; stroke-width: 0.1; stroke-dasharray: 0.5,0.5; }

View file

@ -1 +0,0 @@
export default `circle,path,rect{fill:none;stroke:none}path{stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;stroke-width:.3}.fabric{stroke:#212121;stroke-width:.6}.lining{stroke:#ff5b77;stroke-width:.6}.interfacing{stroke:#64b5f6;stroke-width:.6}.canvas{stroke:#ff9000;stroke-width:.6}.various{stroke:#4caf50;stroke-width:.6}.note{stroke:#dd60dd;stroke-width:.4}.mark{stroke:#00f;stroke-width:.4}.contrast{stroke:red;stroke-width:.8}.fill-fabric{fill:#212121}.fill-lining{fill:#ff5b77}.fill-interfacing{fill:#64b5f6}.fill-canvas{fill:#ff9000}.fill-various{fill:#4caf50}.fill-note{fill:#dd69dd}.fill-mark{fill:#00f}.fill-contrast{fill:red}text{dominant-baseline:ideographic;fill:#000;font-family:-apple-system,system-ui,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:5px;font-weight:200;text-anchor:start}.text-xs{font-size:3px}.text-sm{font-size:4px}.text-lg{font-size:7px}.text-xl{font-size:9px}.text-xxl{font-size:9pt}.center{text-anchor:middle}.right{text-anchor:end}.stroke-xs{stroke-width:.1}.stroke-sm{stroke-width:.2}.stroke-lg{stroke-width:.6}.stroke-xl{stroke-width:1}.stroke-xxl{stroke-width:2}.sa{stroke-dasharray:.4,.8}.help{stroke-dasharray:15,1.5,1,1.5;stroke-width:.2}.dotted{stroke-dasharray:.4,.8}.dashed{stroke-dasharray:1,1.5}.lashed{stroke-dasharray:6,6}.hidden{fill:none;stroke:none}path.grid{fill:none;stroke:#555;stroke-width:.3}path.gridline{stroke:#555;stroke-width:.2}path.gridline-lg{stroke:#777;stroke-dasharray:1.5,1.5;stroke-width:.2}path.gridline-sm{stroke:#999;stroke-width:.1}path.gridline-xs{stroke:#999;stroke-dasharray:.5,.5;stroke-width:.1}`;

View file

@ -3,7 +3,6 @@ export default `<pattern id="grid" height="100" width="100" patternUnits="userSp
<path class="gridline" d="M 50 0 L 50 100 M 0 50 L 100 50" />
<path class="gridline-sm" d="M 10 0 L 10 100 M 20 0 L 20 100 M 30 0 L 30 100 M 40 0 L 40 100 M 60 0 L 60 100 M 70 0 L 70 100 M 80 0 L 80 100 M 90 0 L 90 100" />
<path class="gridline-sm" d="M 0 10 L 100 10 M 0 20 L 100 20 M 0 30 L 100 30 M 0 40 L 100 40 M 0 60 L 100 60 M 0 70 L 100 70 M 0 80 L 100 80 M 0 90 L 100 90" />
<path class="gridline-xs" d="M 5 0 L 5 100 M 15 0 L 15 100 M 25 0 L 25 100 M 35 0 L 35 100 M 45 0 L 45 100 M 55 0 L 55 100 M 65 0 L 65 100 M 75 0 L 75 100 M 85 0 L 85 100 M 95 0 L 95 100" />
<path class="gridline-xs" d="M 0 5 L 100 5 M 0 15 L 100 15 M 0 25 L 100 25 M 0 35 L 100 35 M 0 45 L 100 45 M 0 55 L 100 55 M 0 65 L 100 65 M 0 75 L 100 75 M 0 85 L 100 85 M 0 95 L 100 95" />
</pattern>

View file

@ -1,7 +0,0 @@
path.grid { fill: none; stroke: #555; stroke-width: 0.3; }
path.gridline { stroke: #555; stroke-width: 0.2; }
path.gridline-lg { stroke: #777; stroke-width: 0.2; stroke-dasharray: 1.5,1.5; }
path.gridline-sm { stroke: #999; stroke-width: 0.1; }
path.gridline-xs { stroke: #999; stroke-width: 0.1; stroke-dasharray: 0.5,0.5; }
path.gridbox{fill: url(#grid)}

View file

@ -1 +0,0 @@
export default `path.grid{fill:none;stroke:#555;stroke-width:.3}path.gridline{stroke:#555;stroke-width:.2}path.gridline-lg{stroke:#777;stroke-width:.2;stroke-dasharray:1.5,1.5}path.gridline-sm{stroke:#999;stroke-width:.1}path.gridline-xs{stroke:#999;stroke-width:.1;stroke-dasharray:.5,.5}path.gridbox{fill:url(#grid)}`;

View file

@ -1,12 +0,0 @@
path.sample {stroke-width: 0.75}
path.sample-focus {stroke-width: 1.5; fill: rgba(0,0,0,0.1)}
path.sample-1 {stroke: hsl( 0, 85%, 45%)}
path.sample-2 {stroke: hsl( 30, 85%, 45%)}
path.sample-3 {stroke: hsl( 60, 85%, 45%)}
path.sample-4 {stroke: hsl( 90, 85%, 45%)}
path.sample-5 {stroke: hsl(120, 85%, 45%)}
path.sample-6 {stroke: hsl(150, 85%, 45%)}
path.sample-7 {stroke: hsl(180, 85%, 45%)}
path.sample-8 {stroke: hsl(210, 85%, 45%)}
path.sample-9 {stroke: hsl(240, 85%, 45%)}
path.sample-10 {stroke: hsl(270, 85%, 45%)}

View file

@ -1 +0,0 @@
export default `path.sample{stroke-width:0.75}path.sample-focus{stroke-width:1.5;fill:rgba(0,0,0,0.1)}path.sample-1{stroke:hsl(0,85%,45%)}path.sample-2{stroke:hsl(30,85%,45%)}path.sample-3{stroke:hsl(60,85%,45%)}path.sample-4{stroke:hsl(90,85%,45%)}path.sample-5{stroke:hsl(120,85%,45%)}path.sample-6{stroke:hsl(150,85%,45%)}path.sample-7{stroke:hsl(180,85%,45%)}path.sample-8{stroke:hsl(210,85%,45%)}path.sample-9{stroke:hsl(240,85%,45%)}path.sample-10{stroke:hsl(270,85%,45%)}`;

View file

@ -0,0 +1,58 @@
import freesewing from "freesewing";
import baseCss from "../src/lib/base.css.js";
import notch from "../src/lib/notch";
import gridMetric from "../src/lib/grid-metric";
import gridImperial from "../src/lib/grid-imperial";
import { version, name } from "../package.json";
import plugin from "../dist/index";
let chai = require("chai");
chai.use(require("chai-string"));
let expect = chai.expect;
it("Should load base CSS", () => {
let pattern = new freesewing.Pattern().with(plugin);
pattern.render();
expect(pattern.svg.style).to.equal(baseCss);
});
it("Should load notch defs", () => {
let pattern = new freesewing.Pattern().with(plugin);
pattern.render();
expect(pattern.svg.defs).to.equal(notch);
});
it("Should load the metric grid for paperless", () => {
let pattern = new freesewing.Pattern().with(plugin);
pattern.settings.paperless = true;
pattern.render();
expect(pattern.svg.defs).to.equal(notch + gridMetric);
});
it("Should load the imperial grid for paperless", () => {
let pattern = new freesewing.Pattern().with(plugin);
pattern.settings.paperless = true;
pattern.settings.units = "imperial";
pattern.render();
expect(pattern.svg.defs).to.equal(notch + gridImperial);
});
it("Should inject a part grid for paperless", () => {
let pattern = new freesewing.Pattern().with(plugin);
pattern.settings.paperless = true;
pattern.parts.test = new pattern.Part();
pattern.render();
let box = '<pattern id="grid_test" xlink:href="#grid" x="0" y="0"></pattern>';
expect(pattern.svg.defs).to.equalIgnoreSpaces(notch + gridMetric + box);
});
it("Should inject an anchored part grid for paperless", () => {
let pattern = new freesewing.Pattern().with(plugin);
pattern.settings.paperless = true;
pattern.parts.test = new pattern.Part();
pattern.parts.test.points.anchor = new freesewing.Point(23, 45);
pattern.render();
let box =
'<pattern id="grid_test" xlink:href="#grid" x="23" y="45"></pattern>';
expect(pattern.svg.defs).to.equalIgnoreSpaces(notch + gridMetric + box);
});