Update Edit Inplace behavior and style (#97)

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Charles Bochet
2023-05-04 16:03:13 +02:00
committed by GitHub
parent 3605c0034c
commit e65fd3d6a5
8 changed files with 178 additions and 126 deletions
@@ -0,0 +1,28 @@
import { fireEvent, render } from '@testing-library/react';
import { EditableTextStory } from '../__stories__/EditableText.stories';
it('Checks the EditableCell editing event bubbles up', async () => {
const func = jest.fn(() => null);
const { getByTestId } = render(
<EditableTextStory content="test" changeHandler={func} />,
);
const parent = getByTestId('content-editable-parent');
const wrapper = parent.querySelector('div');
if (!wrapper) {
throw new Error('Editable input not found');
}
fireEvent.click(wrapper);
const editableInput = parent.querySelector('input');
if (!editableInput) {
throw new Error('Editable input not found');
}
fireEvent.change(editableInput, { target: { value: '23' } });
expect(func).toBeCalledWith('23');
});