Skip to content
This repository was archived by the owner on Mar 17, 2024. It is now read-only.

Commit 48c184d

Browse files
committed
fix test
1 parent e25759e commit 48c184d

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

src/__tests__/__snapshots__/render.test.tsx.snap

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
exports[`renderToDot render to container subgraph test 1`] = `
44
digraph {
55
subgraph "test" {
6-
"a";
7-
"b";
86
"a" -> "b";
97
}
108
}

src/__tests__/render.test.tsx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable jest/expect-expect */
22
import React from 'react';
33
import 'jest-graphviz';
4-
import { digraph, toDot } from 'ts-graphviz';
4+
import { digraph, EdgeTargetLikeTuple, toDot } from 'ts-graphviz';
55
import { Edge } from '../components/Edge';
66
import { Node } from '../components/Node';
77
import { renderExpectToThrow } from '../components/__tests__/utils/renderExpectToThrow';
@@ -24,17 +24,9 @@ describe('renderToDot', () => {
2424
});
2525

2626
it('render to container subgraph test', () => {
27-
const nodes = ['a', 'b'];
27+
const nodes: EdgeTargetLikeTuple = ['a', 'b'];
2828
const G = digraph();
29-
const subgraph = render(
30-
<>
31-
{nodes.map((id) => (
32-
<Node id={id} key={id} />
33-
))}
34-
<Edge targets={nodes} />
35-
</>,
36-
G.subgraph('test'),
37-
);
29+
const subgraph = render(<Edge targets={nodes} />, G.subgraph('test'));
3830
expect(G.subgraph('test')).toEqual(subgraph);
3931
expect(toDot(G)).toBeValidDotAndMatchSnapshot();
4032
});

0 commit comments

Comments
 (0)