fix issue with the snapshot

This commit is contained in:
jfh
2020-09-13 23:56:45 +02:00
parent 22e44a0f56
commit b88691d1f3
19 changed files with 369 additions and 201 deletions

View File

@@ -1,51 +1,260 @@
exports[`use various parts of svg-edit > check tool_source #0`] = `
<svg width="640" height="480" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
<g class="layer">
<title>Layer 1</title>
<rect fill="#FF0000" height="70" id="rect" stroke="#000000" stroke-width="5" width="94" x="69.5" y="51.5"/>
</g>
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
width="640"
height="480"
id="svgcontent"
overflow="visible"
x="640"
y="480"
viewBox="0 0 640 480"
>
<g class="layer" style="pointer-events:all">
<title style="pointer-events:inherit">Layer 1</title>
<rect
id="rect"
fill="#FF0000"
height="70"
stroke="#000000"
stroke-width="5"
width="94"
x="69.5"
y="51.5"
style="pointer-events:inherit"
></rect>
</g>
</svg>
`;
exports[`use various parts of svg-edit > check tool_text #0`] = `
<svg width="640" height="480" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
<g class="layer">
<title>Layer 1</title>
<rect fill="#FF0000" height="70" id="rect" stroke="#000000" stroke-width="5" width="94" x="69.5" y="51.5"/>
<text fill="#000000" font-family="serif" font-size="24" id="svg_1" stroke="#000000" stroke-width="0" text-anchor="middle" x="116" xml:space="preserve" y="87">B</text>
</g>
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
width="640"
height="480"
id="svgcontent"
overflow="visible"
x="640"
y="480"
viewBox="0 0 640 480"
>
<g class="layer" style="pointer-events:all">
<title style="pointer-events:inherit">Layer 1</title>
<rect
id="rect"
fill="#FF0000"
height="70"
stroke="#000000"
stroke-width="5"
width="94"
x="69.5"
y="51.5"
style="pointer-events:inherit"
></rect>
<text
fill="#000000"
stroke="#000000"
stroke-width="0"
style="pointer-events: inherit; cursor: text;"
x="116"
y="87"
id="svg_1"
font-size="24"
font-family="serif"
text-anchor="middle"
xml:space="preserve"
fill-opacity="1"
stroke-opacity="1"
>
B
</text>
</g>
</svg>
`;
exports[`use various parts of svg-edit > check tool_clone #0`] = `
<svg width="640" height="480" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
<g class="layer">
<title>Layer 1</title>
<rect fill="#FF0000" height="70" id="rect" stroke="#000000" stroke-width="5" width="94" x="69.5" y="51.5"/>
<text fill="#000000" font-family="serif" font-size="24" id="svg_1" stroke="#000000" stroke-width="0" text-anchor="middle" x="116" xml:space="preserve" y="87">B</text>
<text fill="#000000" font-family="serif" font-size="24" id="svg_2" stroke="#000000" stroke-width="0" text-anchor="middle" x="136" xml:space="preserve" y="107">B</text>
</g>
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
width="640"
height="480"
id="svgcontent"
overflow="visible"
x="640"
y="480"
viewBox="0 0 640 480"
>
<g class="layer" style="pointer-events:all">
<title style="pointer-events:inherit">Layer 1</title>
<rect
id="rect"
fill="#FF0000"
height="70"
stroke="#000000"
stroke-width="5"
width="94"
x="69.5"
y="51.5"
style="pointer-events:inherit"
></rect>
<text
fill="#000000"
stroke="#000000"
stroke-width="0"
x="116"
y="87"
id="svg_1"
font-size="24"
font-family="serif"
text-anchor="middle"
xml:space="preserve"
fill-opacity="1"
stroke-opacity="1"
>
B
</text>
<text
fill="#000000"
stroke="#000000"
stroke-width="0"
x="136"
y="107"
font-size="24"
font-family="serif"
text-anchor="middle"
xml:space="preserve"
fill-opacity="1"
stroke-opacity="1"
id="svg_2"
>
B
</text>
</g>
</svg>
`;
exports[`use various parts of svg-edit > check tool_italic #0`] = `
<svg width="640" height="480" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
<g class="layer">
<title>Layer 1</title>
<rect fill="#FF0000" height="70" id="rect" stroke="#000000" stroke-width="5" width="94" x="69.5" y="51.5"/>
<text fill="#000000" font-family="serif" font-size="24" font-style="italic" id="svg_1" stroke="#000000" stroke-width="0" text-anchor="middle" x="116" xml:space="preserve" y="87">B</text>
<text fill="#000000" font-family="serif" font-size="24" id="svg_2" stroke="#000000" stroke-width="0" text-anchor="middle" x="136" xml:space="preserve" y="107">B</text>
</g>
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
width="640"
height="480"
id="svgcontent"
overflow="visible"
x="640"
y="480"
viewBox="0 0 640 480"
>
<g class="layer" style="pointer-events:all">
<title style="pointer-events:inherit">Layer 1</title>
<rect
id="rect"
fill="#FF0000"
height="70"
stroke="#000000"
stroke-width="5"
width="94"
x="69.5"
y="51.5"
style="pointer-events:inherit"
></rect>
<text
fill="#000000"
stroke="#000000"
stroke-width="0"
x="116"
y="87"
id="svg_1"
font-size="24"
font-family="serif"
text-anchor="middle"
xml:space="preserve"
fill-opacity="1"
stroke-opacity="1"
font-style="italic"
>
B
</text>
<text
fill="#000000"
stroke="#000000"
stroke-width="0"
x="136"
y="107"
font-size="24"
font-family="serif"
text-anchor="middle"
xml:space="preserve"
fill-opacity="1"
stroke-opacity="1"
id="svg_2"
>
B
</text>
</g>
</svg>
`;
exports[`use various parts of svg-edit > check tool_bold #0`] = `
<svg width="640" height="480" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
<g class="layer">
<title>Layer 1</title>
<rect fill="#FF0000" height="70" id="rect" stroke="#000000" stroke-width="5" width="94" x="69.5" y="51.5"/>
<text fill="#000000" font-family="serif" font-size="24" font-style="italic" font-weight="bold" id="svg_1" stroke="#000000" stroke-width="0" text-anchor="middle" x="116" xml:space="preserve" y="87">B</text>
<text fill="#000000" font-family="serif" font-size="24" id="svg_2" stroke="#000000" stroke-width="0" text-anchor="middle" x="136" xml:space="preserve" y="107">B</text>
</g>
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
width="640"
height="480"
id="svgcontent"
overflow="visible"
x="640"
y="480"
viewBox="0 0 640 480"
>
<g class="layer" style="pointer-events:all">
<title style="pointer-events:inherit">Layer 1</title>
<rect
id="rect"
fill="#FF0000"
height="70"
stroke="#000000"
stroke-width="5"
width="94"
x="69.5"
y="51.5"
style="pointer-events:inherit"
></rect>
<text
fill="#000000"
stroke="#000000"
stroke-width="0"
x="116"
y="87"
id="svg_1"
font-size="24"
font-family="serif"
text-anchor="middle"
xml:space="preserve"
fill-opacity="1"
stroke-opacity="1"
font-style="italic"
font-weight="bold"
>
B
</text>
<text
fill="#000000"
stroke="#000000"
stroke-width="0"
x="136"
y="107"
font-size="24"
font-family="serif"
text-anchor="middle"
xml:space="preserve"
fill-opacity="1"
stroke-opacity="1"
id="svg_2"
>
B
</text>
</g>
</svg>
`;

View File

@@ -3,9 +3,10 @@ import {
} from '../../support/ui-test-helper.js';
const testSnapshot = () => {
cy.get('#tool_source').click({force: true});
cy.get('#svg_source_textarea').invoke('val').toMatchSnapshot();
cy.get('#tool_source_save').click({force: true});
// cy.get('#tool_source').click({force: true});
// cy.get('#svg_source_textarea').invoke('val').toMatchSnapshot();
// cy.get('#tool_source_save').click({force: true});
cy.get('#svgcontent').toMatchSnapshot();
};
describe('use various parts of svg-edit', function () {