Fix regressions + fix tests because some inputs does not have onChange event anymore (id, parentId)
This commit is contained in:
parent
6d56ea49cf
commit
ed16cdd61d
3 changed files with 7 additions and 7 deletions
|
@ -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'
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue