RocketChat / RocketChat/Rocket.Chat.ReactNative
Skipped test in app/containers/SearchBox/SearchBox.test.tsx
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.4k
- Forks
- 1.5k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 90
Description
There is a skipped test in the test file for <SearchBox />:
which is a bit of a visual disturbance every time we run yarn test:

From what I understand, this test should simply check that the input's value is set to '' when the (see this PR for more context).
I tried the following implementation:
it('should clear input when clear icon is pressed', async () => {
const { findByTestId } = render(<SearchBox onChangeText={onChangeTextMock} testID={testSearchInputs.testID} />);
const component = await findByTestId(testSearchInputs.testID);
fireEvent.changeText(component, 'new-input-value');
const clearTextInput = await findByTestId('clear-text-input');
fireEvent.press(clearTextInput);
expect(onChangeTextMock).toHaveBeenCalledWith('');
});
and it works.
I'll open a PR to make the change.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open app/containers/SearchBox/SearchBox.test.tsx and review the skipped test at lines 36-44, then read PR 4195 for context. Run yarn test and confirm the SearchBox test is no longer skipped and verifies that pressing the clear control produces the expected empty value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react-native, typescript
- Domain
- mobile, testing
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 30/100