Skip to content

Commit c85f6a0

Browse files
committed
test: Improve Code Coverage
1 parent c63af30 commit c85f6a0

File tree

2 files changed

+723
-18
lines changed

2 files changed

+723
-18
lines changed

@beautiful-tree/react/src/tests/BeautifulTree.test.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ describe('BeautifulTree : Smart Layout', () => {
229229
it('renders small tree, with T-D orientation', () => {
230230
const rendered = render(
231231
<BeautifulTree
232-
id="smart-small-tree"
232+
id="smart-small-tree_T-D-orientation"
233233
svgProps={{
234234
width: 400,
235235
height: 400,
@@ -246,14 +246,15 @@ describe('BeautifulTree : Smart Layout', () => {
246246
it('renders small tree, with L-R orientation', () => {
247247
const rendered = render(
248248
<BeautifulTree
249-
id="smart-small-tree"
249+
id="smart-small-tree_L-R-orientation"
250250
svgProps={{
251251
width: 400,
252252
height: 400,
253253
}}
254254
tree={smallTree}
255255
orientation="L-R"
256256
computeLayout={computeSmartLayout}
257+
getNodeContent={(data): string => data?.['v']?.toString() ?? ''}
257258
/>,
258259
)
259260

@@ -263,14 +264,15 @@ describe('BeautifulTree : Smart Layout', () => {
263264
it('renders small tree, with R-L orientation', () => {
264265
const rendered = render(
265266
<BeautifulTree
266-
id="smart-small-tree"
267+
id="smart-small-tree_R-L-orientation"
267268
svgProps={{
268269
width: 400,
269270
height: 400,
270271
}}
271272
tree={smallTree}
272273
orientation="R-L"
273274
computeLayout={computeSmartLayout}
275+
getNodeContent={(data): string => data?.['v']?.toString() ?? ''}
274276
/>,
275277
)
276278

@@ -280,14 +282,15 @@ describe('BeautifulTree : Smart Layout', () => {
280282
it('renders small tree, with D-T orientation', () => {
281283
const rendered = render(
282284
<BeautifulTree
283-
id="smart-small-tree"
285+
id="smart-small-tree_D-T-orientation"
284286
svgProps={{
285287
width: 400,
286288
height: 400,
287289
}}
288290
tree={smallTree}
289291
orientation="D-T"
290292
computeLayout={computeSmartLayout}
293+
getNodeContent={(data): string => data?.['v']?.toString() ?? ''}
291294
/>,
292295
)
293296

0 commit comments

Comments
 (0)