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
|
||||
labelText='Parent name'
|
||||
inputKey='id'
|
||||
inputKey='parentId'
|
||||
labelClassName=''
|
||||
inputClassName=''
|
||||
type='string'
|
||||
|
|
|
@ -64,10 +64,10 @@ describe.concurrent('Properties', () => {
|
|||
fireEvent.change(propertyParentId as Element, { target: { value: 'parentedId' } });
|
||||
fireEvent.change(propertyX 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.parentId).toBe('parentedId');
|
||||
expect(prop.id).toBe('stuff');
|
||||
expect(prop.parentId).toBe('parentId');
|
||||
expect(prop.x).toBe('2');
|
||||
expect(prop.y).toBe('2');
|
||||
rerender(<Properties
|
||||
|
@ -81,9 +81,9 @@ describe.concurrent('Properties', () => {
|
|||
propertyX = container.querySelector('#x');
|
||||
propertyY = container.querySelector('#y');
|
||||
expect(propertyId).toBeDefined();
|
||||
expect((propertyId as HTMLInputElement).value).toBe('stuffed');
|
||||
expect((propertyId as HTMLInputElement).value).toBe('stuff');
|
||||
expect(propertyParentId).toBeDefined();
|
||||
expect((propertyParentId as HTMLInputElement).value).toBe('parentedId');
|
||||
expect((propertyParentId as HTMLInputElement).value).toBe('parentId');
|
||||
expect(propertyX).toBeDefined();
|
||||
expect((propertyX as HTMLInputElement).value).toBe('2');
|
||||
expect(propertyY).toBeDefined();
|
||||
|
|
|
@ -43,7 +43,7 @@ const StaticForm: React.FunctionComponent<IStaticFormProps> = (props) => {
|
|||
/>
|
||||
<InputGroup
|
||||
labelText='Parent name'
|
||||
inputKey='id'
|
||||
inputKey='parentId'
|
||||
labelClassName=''
|
||||
inputClassName=''
|
||||
type='string'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue