* Add filter search logic WIP Filter search Implement filters test: fix sorts tests test: fix filter test feature: search person and display firstname in results feature: fix test for filter component test: mock search filters refactor: create a useSearch hook refactor: move debounce in useSearch and reset status of filter selection feature: debounce set filters refactor: remove useless setSorts feature: add where variable to people query feature: strongly type Filters feature: update WhereTemplate method feature: implement filtering on full name feature: type the useSearch hook feature: use where reducer refactor: create a type for readability feature: use query and mapper from filters feature: implement filter by company feature: search filter results on filter select feature: add loading and results to search results in filters refactor: move render search results in a function feature: display a LOADING when it loads feature: split search input and search filter for different debounce refactor: remove some warnings refactor: remove some warnings * Write test 1 * Write test 2 * test: useSearch is tested * test: update names of default people data * test: add a filter search * Test 3 * Fix tests --------- Co-authored-by: Charles Bochet <charles@twenty.com>
21 lines
639 B
TypeScript
21 lines
639 B
TypeScript
import { fireEvent, render } from '@testing-library/react';
|
|
|
|
import { EditableCellStory } from '../__stories__/EditableCell.stories';
|
|
|
|
it('Checks the EditableCell editing event bubbles up', async () => {
|
|
const func = jest.fn(() => null);
|
|
const { getByTestId } = render(
|
|
<EditableCellStory content="test" changeHandler={func} />,
|
|
);
|
|
|
|
const parent = getByTestId('content-editable-parent');
|
|
const editableInput = parent.querySelector('input');
|
|
|
|
if (!editableInput) {
|
|
throw new Error('Editable input not found');
|
|
}
|
|
|
|
fireEvent.change(editableInput, { target: { value: '23' } });
|
|
expect(func).toBeCalledWith('23');
|
|
});
|