This repository was archived by the owner on Mar 17, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +3
-13
lines changed
Expand file tree Collapse file tree 2 files changed +3
-13
lines changed Original file line number Diff line number Diff line change 33exports [` renderToDot render to container subgraph test 1` ] = `
44digraph {
55 subgraph " test" {
6- "a";
7- "b";
86 "a" -> "b";
97 }
108}
Original file line number Diff line number Diff line change 11/* eslint-disable jest/expect-expect */
22import React from 'react' ;
33import 'jest-graphviz' ;
4- import { digraph , toDot } from 'ts-graphviz' ;
4+ import { digraph , EdgeTargetLikeTuple , toDot } from 'ts-graphviz' ;
55import { Edge } from '../components/Edge' ;
66import { Node } from '../components/Node' ;
77import { 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 } ) ;
You can’t perform that action at this time.
0 commit comments