Fix regressions + fix tests because some inputs does not have onChange event anymore (id, parentId)
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
Eric NGUYEN 2022-08-16 13:53:47 +02:00
parent 6d56ea49cf
commit ed16cdd61d
3 changed files with 7 additions and 7 deletions

View file

@ -43,7 +43,7 @@ const DynamicForm: React.FunctionComponent<IDynamicFormProps> = (props) => {
/> />
<InputGroup <InputGroup
labelText='Parent name' labelText='Parent name'
inputKey='id' inputKey='parentId'
labelClassName='' labelClassName=''
inputClassName='' inputClassName=''
type='string' type='string'

View file

@ -64,10 +64,10 @@ describe.concurrent('Properties', () => {
fireEvent.change(propertyParentId as Element, { target: { value: 'parentedId' } }); fireEvent.change(propertyParentId as Element, { target: { value: 'parentedId' } });
fireEvent.change(propertyX as Element, { target: { value: '2' } }); fireEvent.change(propertyX as Element, { target: { value: '2' } });
fireEvent.change(propertyY as Element, { target: { value: '2' } }); fireEvent.change(propertyY as Element, { target: { value: '2' } });
expect(handleChange).toBeCalledTimes(4); expect(handleChange).toBeCalledTimes(2);
expect(prop.id).toBe('stuffed'); expect(prop.id).toBe('stuff');
expect(prop.parentId).toBe('parentedId'); expect(prop.parentId).toBe('parentId');
expect(prop.x).toBe('2'); expect(prop.x).toBe('2');
expect(prop.y).toBe('2'); expect(prop.y).toBe('2');
rerender(<Properties rerender(<Properties
@ -81,9 +81,9 @@ describe.concurrent('Properties', () => {
propertyX = container.querySelector('#x'); propertyX = container.querySelector('#x');
propertyY = container.querySelector('#y'); propertyY = container.querySelector('#y');
expect(propertyId).toBeDefined(); expect(propertyId).toBeDefined();
expect((propertyId as HTMLInputElement).value).toBe('stuffed'); expect((propertyId as HTMLInputElement).value).toBe('stuff');
expect(propertyParentId).toBeDefined(); expect(propertyParentId).toBeDefined();
expect((propertyParentId as HTMLInputElement).value).toBe('parentedId'); expect((propertyParentId as HTMLInputElement).value).toBe('parentId');
expect(propertyX).toBeDefined(); expect(propertyX).toBeDefined();
expect((propertyX as HTMLInputElement).value).toBe('2'); expect((propertyX as HTMLInputElement).value).toBe('2');
expect(propertyY).toBeDefined(); expect(propertyY).toBeDefined();

View file

@ -43,7 +43,7 @@ const StaticForm: React.FunctionComponent<IStaticFormProps> = (props) => {
/> />
<InputGroup <InputGroup
labelText='Parent name' labelText='Parent name'
inputKey='id' inputKey='parentId'
labelClassName='' labelClassName=''
inputClassName='' inputClassName=''
type='string' type='string'