Commit 57d104f7 authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

Test nodeSize

parent ed0b9112
Pipeline #12412 passed with stage
in 56 seconds
...@@ -46,7 +46,7 @@ describe("Test layout", () => { ...@@ -46,7 +46,7 @@ describe("Test layout", () => {
return (curr.data.name === "child10") ? curr : acc; return (curr.data.name === "child10") ? curr : acc;
}, pointData) }, pointData)
test("Root node middle height", () => { test("Root node middle height", () => {
expect(pointData.x).toBe(405); expect(pointData.x).toBe(375);
}) })
// Test X // Test X
...@@ -68,4 +68,16 @@ describe("Test layout", () => { ...@@ -68,4 +68,16 @@ describe("Test layout", () => {
expect(nodes.r).toBe(2); expect(nodes.r).toBe(2);
} }
}) })
// Change how define size
test("nodeSize", () => {
const xStep = 50;
const newData = phylogramLayout.nodeSize([xStep, 100])(data);
let yExpected = 0;
newData.leaves().forEach(leaf => {
expect(leaf.x).toBe(yExpected);
yExpected += xStep;
});
});
}) })
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment