Skip to content

Commit

Permalink
Fix: Update test with .toMatchSnapshot to test UI (#243)
Browse files Browse the repository at this point in the history
* update test

* Use .toEqual for small assertions. Remove arguments from .toMatchSnapshot calls
  • Loading branch information
jaydinsweo authored and danielcaldas committed Oct 2, 2019
1 parent 6f99b90 commit ba59513
Show file tree
Hide file tree
Showing 4 changed files with 410 additions and 88 deletions.
103 changes: 103 additions & 0 deletions test/graph/__snapshots__/graph.builder.spec.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Graph Helper #buildNodeProps when node to build is the highlightedLink target (or source) and highlight degree is 0 should properly build node props () 1`] = `
Object {
"className": "node",
"color": "green",
"cursor": "pointer",
"cx": 1,
"cy": 2,
"dx": 11.5,
"fill": "green",
"fontColor": "black",
"fontSize": 8,
"fontWeight": "normal",
"highlighted": false,
"id": "id",
"label": "id",
"onClickNode": undefined,
"onMouseOut": undefined,
"onMouseOverNode": undefined,
"onRightClickNode": undefined,
"opacity": undefined,
"overrideGlobalViewGenerator": undefined,
"renderLabel": true,
"size": 200,
"stroke": "none",
"strokeWidth": 1.5,
"svg": "file.svg",
"symbolType": undefined,
"type": "circle",
"viewGenerator": null,
"x": 1,
"y": 2,
}
`;

exports[`Graph Helper #buildNodeProps when node to build is the highlightedLink target (or source) and highlight degree is bigger then 0 should properly build node props 1`] = `
Object {
"className": "node",
"color": "green",
"cursor": "pointer",
"cx": 1,
"cy": 2,
"dx": 11.5,
"fill": "green",
"fontColor": "black",
"fontSize": 8,
"fontWeight": "normal",
"highlighted": false,
"id": "id",
"label": "id",
"onClickNode": undefined,
"onMouseOut": undefined,
"onMouseOverNode": undefined,
"onRightClickNode": undefined,
"opacity": undefined,
"overrideGlobalViewGenerator": undefined,
"renderLabel": true,
"size": 200,
"stroke": "none",
"strokeWidth": 1.5,
"svg": "file.svg",
"symbolType": undefined,
"type": "circle",
"viewGenerator": null,
"x": 1,
"y": 2,
}
`;

exports[`Graph Helper #buildNodeProps when node to build is the highlightedNode should return node props with proper highlight values 1`] = `
Object {
"className": "node",
"color": "green",
"cursor": "pointer",
"cx": 1,
"cy": 2,
"dx": 15.5,
"fill": "red",
"fontColor": "black",
"fontSize": 12,
"fontWeight": "bold",
"highlighted": true,
"id": "id",
"label": "id",
"onClickNode": undefined,
"onMouseOut": undefined,
"onMouseOverNode": undefined,
"onRightClickNode": undefined,
"opacity": 1,
"overrideGlobalViewGenerator": undefined,
"renderLabel": true,
"size": 200,
"stroke": "yellow",
"strokeWidth": 2,
"svg": "file.svg",
"symbolType": undefined,
"type": "circle",
"viewGenerator": null,
"x": 1,
"y": 2,
}
`;
Loading

0 comments on commit ba59513

Please sign in to comment.