Skip to content

Commit 1cbf516

Browse files
authored
test: add failing test for #776 (#778)
1 parent f3283b8 commit 1cbf516

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

src/__tests__/byText.test.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,37 @@ test('findByText queries work asynchronously', async () => {
105105
await expect(findAllByText('Some Text')).resolves.toHaveLength(1);
106106
}, 20000);
107107

108+
test.skip('getByText works properly with custom text component', () => {
109+
function BoldText({ children }) {
110+
return <Text>{children}</Text>;
111+
}
112+
113+
expect(
114+
render(
115+
<Text>
116+
<BoldText>Hello</BoldText>
117+
</Text>
118+
).getByText('Hello')
119+
).toBeTruthy();
120+
});
121+
122+
test.skip('getByText works properly with custom text container', () => {
123+
function MyText({ children }) {
124+
return <Text>{children}</Text>;
125+
}
126+
function BoldText({ children }) {
127+
return <Text>{children}</Text>;
128+
}
129+
130+
expect(
131+
render(
132+
<MyText>
133+
<BoldText>Hello</BoldText>
134+
</MyText>
135+
).getByText('Hello')
136+
).toBeTruthy();
137+
});
138+
108139
test('queryByText nested <Image> in <Text> at start', () => {
109140
expect(
110141
render(

0 commit comments

Comments
 (0)