Skip to content

Commit 5e0d157

Browse files
committed
adds 2 level fragment test
1 parent caf8a93 commit 5e0d157

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/lib/src/childQueries/unwrapRootFragment/unwrapRootFragment.spec.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,18 @@ describe('packages/lib/unwrapRootFragment', () => {
2626
expect(unwrapped).toHaveLength(2);
2727
});
2828

29+
test('only unwraps a single layer of Fragments', () => {
30+
const unwrapped = unwrapRootFragment(
31+
<Fragment>
32+
<Fragment>
33+
<div />
34+
<div />
35+
</Fragment>
36+
</Fragment>,
37+
);
38+
expect(unwrapped).toHaveLength(1);
39+
});
40+
2941
test('returns an empty array children has no length', () => {
3042
const unwrapped = unwrapRootFragment([]);
3143
expect(unwrapped).toBeDefined();

0 commit comments

Comments
 (0)