Skip to content

Commit b891395

Browse files
committed
chore: improve code coverage
1 parent fa35bc9 commit b891395

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
node_modules
2+
coverage
23
*.log
34
.eslintcache
45
build

src/helpers/__tests__/component-tree.test.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ describe('getHostParent()', () => {
4545
expect(getHostParent(hostGrandparent)).toBe(null);
4646
});
4747

48+
it('returns host parent for null', () => {
49+
expect(getHostParent(null)).toBe(null);
50+
});
51+
4852
it('returns host parent for composite component', () => {
4953
const view = render(
5054
<View testID="parent">
@@ -65,7 +69,7 @@ describe('getHostChildren()', () => {
6569
<View testID="grandparent">
6670
<View testID="parent">
6771
<View testID="subject" />
68-
<View testID="sibling" />
72+
<Text testID="sibling">Hello</Text>
6973
</View>
7074
</View>
7175
);
@@ -74,6 +78,8 @@ describe('getHostChildren()', () => {
7478
expect(getHostChildren(hostSubject)).toEqual([]);
7579

7680
const hostSibling = view.getByTestId('sibling');
81+
expect(getHostChildren(hostSibling)).toEqual([]);
82+
7783
const hostParent = view.getByTestId('parent');
7884
expect(getHostChildren(hostParent)).toEqual([hostSubject, hostSibling]);
7985

0 commit comments

Comments
 (0)