diff --git a/src/__tests__/findByApi.test.js b/src/__tests__/findByApi.test.js index f924cb1b3..da05cba8c 100644 --- a/src/__tests__/findByApi.test.js +++ b/src/__tests__/findByApi.test.js @@ -18,19 +18,19 @@ test('findBy queries work asynchronously', async () => { } = render(); await expect(findByTestId('aTestId', options)).rejects.toBeTruthy(); await expect(findAllByTestId('aTestId', options)).rejects.toBeTruthy(); - await expect(findByText('Some Text', options)).rejects.toBeTruthy(); - await expect(findAllByText('Some Text', options)).rejects.toBeTruthy(); + await expect(findByText('Some Text', {}, options)).rejects.toBeTruthy(); + await expect(findAllByText('Some Text', {}, options)).rejects.toBeTruthy(); await expect( - findByPlaceholderText('Placeholder Text', options) + findByPlaceholderText('Placeholder Text', {}, options) ).rejects.toBeTruthy(); await expect( - findAllByPlaceholderText('Placeholder Text', options) + findAllByPlaceholderText('Placeholder Text', {}, options) ).rejects.toBeTruthy(); await expect( - findByDisplayValue('Display Value', options) + findByDisplayValue('Display Value', {}, options) ).rejects.toBeTruthy(); await expect( - findAllByDisplayValue('Display Value', options) + findAllByDisplayValue('Display Value', {}, options) ).rejects.toBeTruthy(); setTimeout( diff --git a/src/__tests__/getByApi.test.js b/src/__tests__/getByApi.test.js index a2b2637d1..9fea5924f 100644 --- a/src/__tests__/getByApi.test.js +++ b/src/__tests__/getByApi.test.js @@ -1,7 +1,7 @@ // @flow import React from 'react'; import { View, Text, TextInput, Button } from 'react-native'; -import { render } from '..'; +import { render, getDefaultNormalizer } from '..'; const MyComponent = () => { return My Component; @@ -50,3 +50,114 @@ test('supports a regex matcher', () => { expect(getByTestId(/view/)).toBeTruthy(); expect(getAllByTestId(/text/)).toHaveLength(2); }); + +describe('Supports a TextMatch options', () => { + test('getByText, getAllByText', () => { + const { getByText, getAllByText } = render( + + Text and details +