Skip to content

Commit 43ed115

Browse files
committed
chore: expand test coverage
1 parent eaf3e1c commit 43ed115

File tree

5 files changed

+27
-6
lines changed

5 files changed

+27
-6
lines changed

src/matchers/__tests__/to-be-checked.test.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import React from 'react';
22
import { type AccessibilityRole, Switch, View } from 'react-native';
3-
import render from '../../render';
4-
import { screen } from '../../screen';
3+
import { render, screen, configure } from '../..';
54
import '../extend-expect';
65

6+
beforeEach(() => {
7+
configure({ renderer: 'internal' });
8+
});
9+
710
function renderViewsWithRole(role: AccessibilityRole) {
811
render(
912
<>

src/matchers/__tests__/to-be-disabled.test.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@ import {
1010
Text,
1111
View,
1212
} from 'react-native';
13-
import { render, screen } from '../..';
13+
import { configure, render, screen } from '../..';
1414
import '../extend-expect';
1515

16+
// beforeEach(() => {
17+
// configure({ renderer: 'internal' });
18+
// });
19+
1620
test('toBeDisabled()/toBeEnabled() supports basic case', () => {
1721
render(
1822
<View>

src/matchers/__tests__/to-be-empty-element.test.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { View } from 'react-native';
3-
import { render, screen } from '../..';
3+
import { configure, render, screen } from '../..';
44
import '../extend-expect';
55

66
// eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -9,6 +9,10 @@ function DoNotRenderChildren({ children }: { children: React.ReactNode }) {
99
return null;
1010
}
1111

12+
beforeEach(() => {
13+
configure({ renderer: 'internal' });
14+
});
15+
1216
test('toBeEmptyElement() base case', () => {
1317
render(
1418
<View testID="not-empty">

src/matchers/__tests__/to-be-expanded.test.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
import * as React from 'react';
22
import { View } from 'react-native';
3-
import { render, screen } from '../..';
3+
import { configure, render, screen } from '../..';
44
import '../extend-expect';
55

6+
beforeEach(() => {
7+
configure({ renderer: 'internal' });
8+
});
9+
610
test('toBeExpanded() basic case', () => {
711
render(
812
<>

src/renderer/host-element.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@ export class HostElement {
2121
}
2222

2323
get props(): HostElementProps {
24-
return this.instance.tag === 'INSTANCE' ? this.instance.props : {};
24+
if (this.instance.tag === 'CONTAINER') {
25+
return {};
26+
}
27+
28+
// // eslint-disable-next-line @typescript-eslint/no-unused-vars
29+
// const { children, ...restProps } = this.instance.props;
30+
return this.instance.props;
2531
}
2632

2733
get children(): HostNode[] {

0 commit comments

Comments
 (0)