fix(core): Svg tests
This commit is contained in:
parent
29551b8a34
commit
eda88bce4d
2 changed files with 15 additions and 15 deletions
18
packages/core/tests/fixtures/render.js
vendored
18
packages/core/tests/fixtures/render.js
vendored
|
@ -1,4 +1,4 @@
|
||||||
var version = require("../../package.json").version;
|
var version = require('../../package.json').version
|
||||||
|
|
||||||
var render = {
|
var render = {
|
||||||
boilerplate: `<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg
|
boilerplate: `<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg
|
||||||
|
@ -91,7 +91,7 @@ var render = {
|
||||||
<!-- end of group #fs-container -->
|
<!-- end of group #fs-container -->
|
||||||
</svg>`,
|
</svg>`,
|
||||||
path: `<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg
|
path: `<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg
|
||||||
xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:lang="en" xmlns:freesewing="http://freesewing.org/namespaces/freesewing" freesewing="${version}" width="44mm" height="56.45mm" viewBox="0 0 44 56.45"
|
xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:lang="en" xmlns:freesewing="http://freesewing.org/namespaces/freesewing" freesewing="${version}" width="44mm" height="56.45mm" viewBox="0 0 44 56.451075975520425"
|
||||||
>
|
>
|
||||||
<style type="text/css"> <![CDATA[
|
<style type="text/css"> <![CDATA[
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ var render = {
|
||||||
<g id="fs-container">
|
<g id="fs-container">
|
||||||
|
|
||||||
<!-- Start of group #fs-part-test -->
|
<!-- Start of group #fs-part-test -->
|
||||||
<g id="fs-part-test" transform=" translate(2, 2)">
|
<g id="fs-part-test" transform="translate(2, 2)">
|
||||||
<path id="something" class="freesewing" d="M 0,0 L 40,20 C 12,34 56,78 21,32 z" />
|
<path id="something" class="freesewing" d="M 0,0 L 40,20 C 12,34 56,78 21,32 z" />
|
||||||
</g>
|
</g>
|
||||||
<!-- end of group #fs-part-test -->
|
<!-- end of group #fs-part-test -->
|
||||||
|
@ -233,7 +233,7 @@ var render = {
|
||||||
<!-- end of group #fs-container -->
|
<!-- end of group #fs-container -->
|
||||||
</svg>`,
|
</svg>`,
|
||||||
textOnPath: `<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg
|
textOnPath: `<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg
|
||||||
xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:lang="en" xmlns:freesewing="http://freesewing.org/namespaces/freesewing" freesewing="${version}" width="44mm" height="56.45mm" viewBox="0 0 44 56.45"
|
xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:lang="en" xmlns:freesewing="http://freesewing.org/namespaces/freesewing" freesewing="${version}" width="44mm" height="56.45mm" viewBox="0 0 44 56.451075975520425"
|
||||||
>
|
>
|
||||||
<style type="text/css"> <![CDATA[
|
<style type="text/css"> <![CDATA[
|
||||||
|
|
||||||
|
@ -252,7 +252,7 @@ var render = {
|
||||||
<g id="fs-container">
|
<g id="fs-container">
|
||||||
|
|
||||||
<!-- Start of group #fs-part-test -->
|
<!-- Start of group #fs-part-test -->
|
||||||
<g id="fs-part-test" transform=" translate(2, 2)">
|
<g id="fs-part-test" transform="translate(2, 2)">
|
||||||
<path data-text="This is another test" data-text-class="text-sm" class="freesewing" id="fs-1" d="M 0,0 L 40,20 C 12,34 56,78 21,32 z" />
|
<path data-text="This is another test" data-text-class="text-sm" class="freesewing" id="fs-1" d="M 0,0 L 40,20 C 12,34 56,78 21,32 z" />
|
||||||
<text><textPath xlink:href="#fs-1" ><tspan class="text-sm">This is another test</tspan></textPath>
|
<text><textPath xlink:href="#fs-1" ><tspan class="text-sm">This is another test</tspan></textPath>
|
||||||
</text>
|
</text>
|
||||||
|
@ -262,7 +262,7 @@ var render = {
|
||||||
<!-- end of group #fs-container -->
|
<!-- end of group #fs-container -->
|
||||||
</svg>`,
|
</svg>`,
|
||||||
textOnPathCenter: `<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg
|
textOnPathCenter: `<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg
|
||||||
xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:lang="en" xmlns:freesewing="http://freesewing.org/namespaces/freesewing" freesewing="${version}" width="44mm" height="56.45mm" viewBox="0 0 44 56.45"
|
xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:lang="en" xmlns:freesewing="http://freesewing.org/namespaces/freesewing" freesewing="${version}" width="44mm" height="56.45mm" viewBox="0 0 44 56.451075975520425"
|
||||||
>
|
>
|
||||||
<style type="text/css"> <![CDATA[
|
<style type="text/css"> <![CDATA[
|
||||||
|
|
||||||
|
@ -291,7 +291,7 @@ var render = {
|
||||||
<!-- end of group #fs-container -->
|
<!-- end of group #fs-container -->
|
||||||
</svg>`,
|
</svg>`,
|
||||||
textOnPathRight: `<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg
|
textOnPathRight: `<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg
|
||||||
xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:lang="en" xmlns:freesewing="http://freesewing.org/namespaces/freesewing" freesewing="${version}" width="44mm" height="56.45mm" viewBox="0 0 44 56.45"
|
xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:lang="en" xmlns:freesewing="http://freesewing.org/namespaces/freesewing" freesewing="${version}" width="44mm" height="56.45mm" viewBox="0 0 44 56.451075975520425"
|
||||||
>
|
>
|
||||||
<style type="text/css"> <![CDATA[
|
<style type="text/css"> <![CDATA[
|
||||||
|
|
||||||
|
@ -346,6 +346,6 @@ var render = {
|
||||||
</g>
|
</g>
|
||||||
<!-- end of group #fs-container -->
|
<!-- end of group #fs-container -->
|
||||||
</svg>`
|
</svg>`
|
||||||
};
|
}
|
||||||
|
|
||||||
module.exports = render;
|
module.exports = render
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
let version = require("../package.json").version;
|
const version = require("../package.json").version;
|
||||||
let render = require("./fixtures/render.js");
|
const render = require("./fixtures/render.js");
|
||||||
let expect = require("chai").expect;
|
const expect = require("chai").expect;
|
||||||
let chai = require("chai");
|
const chai = require("chai");
|
||||||
chai.use(require("chai-string"));
|
chai.use(require("chai-string"));
|
||||||
let freesewing = require("./dist");
|
const freesewing = require("./dist");
|
||||||
var round = freesewing.utils.round;
|
const round = freesewing.utils.round;
|
||||||
|
|
||||||
it("Svg constructor should initialize object", () => {
|
it("Svg constructor should initialize object", () => {
|
||||||
let pattern = new freesewing.Pattern();
|
let pattern = new freesewing.Pattern();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue