Skip to content

Instantly share code, notes, and snippets.

@ryanvazquez
Created May 14, 2020 18:38
Show Gist options
  • Save ryanvazquez/0f4002a175d4aa9400c986d8aaff6c47 to your computer and use it in GitHub Desktop.
Save ryanvazquez/0f4002a175d4aa9400c986d8aaff6c47 to your computer and use it in GitHub Desktop.
Summary of all failing tests
FAIL src/plugins/lineage/DagreGrNode.test.js
● <Node /> › renders the supplied element
TypeError: Cannot assign to read only property 'getBBox' of object '[object HTMLUnknownElement]'

 10 | describe('<Node />', () => {
 11 | beforeEach(() => {
> 12 | window.HTMLUnknownElement.prototype.getBBox = function() {
 | ^
 13 | return { width: 100, height: 100 };
 14 | };
 15 | });

 at Object.<anonsrc/plugins/lineage/DagreGraph/Node.test.js:12:5)
● <Node /> › passes down props to the render method
TypeError: Cannot assign to read only property 'getBBox' of object '[object HTMLUnknownElement]'

 10 | describe('<Node />', () => {
 11 | beforeEach(() => {
> 12 | window.HTMLUnknownElement.prototype.getBBox = function() {
 | ^
 13 | return { width: 100, height: 100 };
 14 | };
 15 | });

 at Object.<anonsrc/plugins/lineage/DagreGraph/Node.test.js:12:5)
● <Node /> › calls setNode with node ID and actual size after rendering
TypeError: Cannot assign to read only property 'getBBox' of object '[object HTMLUnknownElement]'

 10 | describe('<Node />', () => {
 11 | beforeEach(() => {
> 12 | window.HTMLUnknownElement.prototype.getBBox = function() {
 | ^
 13 | return { width: 100, height: 100 };
 14 | };
 15 | });

 at Object.<anonsrc/plugins/lineage/DagreGraph/Node.test.js:12:5)
● <Node /> › calls setNode with node ID and actual size after rendering
expjest.fn()).toHaveBeenCa...expected)
- Expected
+ Received
"abc",
 Object {
- "height": 100,
+ "height": 500,
 "id": "abc",
- "width": 100,
+ "width": 1000,
 },
Number of calls: 1

 43 | expect(getByText('abc')).toBeInTheDocument();
 44 | // Updates the node in the graph
> 45 | expect(setNode).toHaveBeenCalledWith('abc', { height: 100, width: 100, id: 'abc' });
 | ^
 46 | 
 47 | // Renders with initial values and propagates calculated values to the rendered element
 48 | expect(renderElement).toHaveBeenCalledTimes(2);

 at Object.toHaveBeenCallsrc/plugins/lineage/DagreGraph/Node.test.js:45:21)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment