This repository was archived by the owner on Jul 30, 2020. It is now read-only.
This repository was archived by the owner on Jul 30, 2020. It is now read-only.
Queries passed as options to render not being returned #15
Closed
Description
The documentation mentions that queries
can be passed as an option to render to specify which queries to bind, or add custom bound queries
react-native
orexpo
: react-nativenative-testing-library
version: 2.0.1react-native
version: 0.59.5node
version: 8.15.1npm
(oryarn
) version: yarn 1.15.2
Relevant code or config:
The following test should pass
test('returns the queries passed as options bound to the container', () => {
const _getQueryPassedAsOption = { bind: jest.fn(() => _getQueryPassedAsOption) }
const queries = { getQueryPassedAsOption: _getQueryPassedAsOption };
const { container, getQueryPassedAsOption } = render(<View />, { queries });
expect(queries.getQueryPassedAsOption.bind).toHaveBeenCalledWith(null,container);
expect(getQueryPassedAsOption).toEqual(_getQueryPassedAsOption);
});
Reproduction:
Add the test to any project with native-testing-library
and it'll fail.
Problem description:
It should work as documented.
Suggested solution:
I'll submit a PR with the fix. Just give me a few minutes