fixed change in xml output for tests
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@ const rendering = require('./rendering');
|
|||||||
|
|
||||||
const self = {
|
const self = {
|
||||||
/**
|
/**
|
||||||
* @param {{options: Object, nodes: Object[], links: Object[]}} data
|
* @param {{options: Object|undefined, nodes: Object[]|undefined, links: Object[]|undefined}} data
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
compute: (data) => {
|
compute: (data) => {
|
||||||
|
|||||||
+1
-1
@@ -28,5 +28,5 @@ test('test fail placing', () => {
|
|||||||
|
|
||||||
test('no data', () => {
|
test('no data', () => {
|
||||||
const res = faDiagrams.compute({});
|
const res = faDiagrams.compute({});
|
||||||
expect(res).toEqual('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 0 0" width="0" height="0"></svg>');
|
expect(res).toEqual('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 0 0" width="0" height="0" stroke="black" fill="black"></svg>');
|
||||||
});
|
});
|
||||||
@@ -103,7 +103,7 @@ describe('getBounds', () => {
|
|||||||
describe('toXML', () => {
|
describe('toXML', () => {
|
||||||
test('no data', () => {
|
test('no data', () => {
|
||||||
const res = rendering({scale: 20, 'h-spacing': 1}).toXML({}, {w: 0, h: 0});
|
const res = rendering({scale: 20, 'h-spacing': 1}).toXML({}, {w: 0, h: 0});
|
||||||
expect(res).toEqual('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 0 0" width="0" height="0"/>');
|
expect(res).toEqual('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 0 0" width="0" height="0" stroke="black" fill="black"/>');
|
||||||
});
|
});
|
||||||
test('sample svg data', () => {
|
test('sample svg data', () => {
|
||||||
const res = rendering({scale: 2, 'h-spacing': 1}).toXML({
|
const res = rendering({scale: 2, 'h-spacing': 1}).toXML({
|
||||||
@@ -115,14 +115,14 @@ describe('toXML', () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, {w: 100, h: 100});
|
}, {w: 100, h: 100});
|
||||||
expect(res).toEqual('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="500" height="500"><circle cx="50" cy="50" r="50"/></svg>');
|
expect(res).toEqual('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="500" height="500" stroke="black" fill="black"><circle cx="50" cy="50" r="50"/></svg>');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('compute', () => {
|
describe('compute', () => {
|
||||||
test('no nodes no links', () => {
|
test('no nodes no links', () => {
|
||||||
const res = rendering({beautify: true, 'h-spacing': 1.2, scale: 20}).compute({}, []);
|
const res = rendering({beautify: true, 'h-spacing': 1.2, scale: 20}).compute({}, []);
|
||||||
expect(res).toEqual('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 0 0" width="0" height="0">\n</svg>');
|
expect(res).toEqual('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 0 0" width="0" height="0" stroke="black" fill="black">\n</svg>');
|
||||||
});
|
});
|
||||||
test('invalid node', () => {
|
test('invalid node', () => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user