Fix regression + fix tests
This commit is contained in:
parent
3d710f6f7e
commit
d07353d02e
3 changed files with 18 additions and 18 deletions
|
@ -72,12 +72,12 @@ describe.concurrent('Elements sidebar', () => {
|
|||
expect(screen.queryByText('y')).toBeDefined();
|
||||
expect(screen.queryByText('width')).toBeDefined();
|
||||
expect(screen.queryByText('height')).toBeDefined();
|
||||
const propertyId = container.querySelector('#property-id');
|
||||
const propertyParentId = container.querySelector('#property-parentId');
|
||||
const propertyX = container.querySelector('#property-x');
|
||||
const propertyY = container.querySelector('#property-y');
|
||||
const propertyWidth = container.querySelector('#property-width');
|
||||
const propertyHeight = container.querySelector('#property-height');
|
||||
const propertyId = container.querySelector('#id');
|
||||
const propertyParentId = container.querySelector('#parentId');
|
||||
const propertyX = container.querySelector('#x');
|
||||
const propertyY = container.querySelector('#y');
|
||||
const propertyWidth = container.querySelector('#width');
|
||||
const propertyHeight = container.querySelector('#height');
|
||||
expect((propertyId as HTMLInputElement).value).toBe(MainContainer.properties.id.toString());
|
||||
expect(propertyParentId).toBeDefined();
|
||||
expect((propertyParentId as HTMLInputElement).value).toBe('');
|
||||
|
@ -216,8 +216,8 @@ describe.concurrent('Elements sidebar', () => {
|
|||
expect(screen.getByText(/main/i));
|
||||
const child1 = screen.getByText(/child-1/i);
|
||||
expect(child1);
|
||||
const propertyId = container.querySelector('#property-id');
|
||||
const propertyParentId = container.querySelector('#property-parentId');
|
||||
const propertyId = container.querySelector('#id');
|
||||
const propertyParentId = container.querySelector('#parentId');
|
||||
expect((propertyId as HTMLInputElement).value).toBe(MainContainer.properties.id.toString());
|
||||
expect((propertyParentId as HTMLInputElement).value).toBe('');
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ describe.concurrent('Properties', () => {
|
|||
expect(screen.queryByText('y')).toBeNull();
|
||||
});
|
||||
|
||||
it('Some properties', () => {
|
||||
it('Some properties, change values with dynamic input', () => {
|
||||
const prop = {
|
||||
id: 'stuff',
|
||||
parentId: 'parentId',
|
||||
|
@ -41,10 +41,10 @@ describe.concurrent('Properties', () => {
|
|||
expect(screen.queryByText('x')).toBeDefined();
|
||||
expect(screen.queryByText('y')).toBeDefined();
|
||||
|
||||
let propertyId = container.querySelector('#property-id');
|
||||
let propertyParentId = container.querySelector('#property-parentId');
|
||||
let propertyX = container.querySelector('#property-x');
|
||||
let propertyY = container.querySelector('#property-y');
|
||||
let propertyId = container.querySelector('#id');
|
||||
let propertyParentId = container.querySelector('#parentId');
|
||||
let propertyX = container.querySelector('#x');
|
||||
let propertyY = container.querySelector('#y');
|
||||
expect(propertyId).toBeDefined();
|
||||
expect((propertyId as HTMLInputElement).value).toBe('stuff');
|
||||
expect(propertyParentId).toBeDefined();
|
||||
|
@ -70,10 +70,10 @@ describe.concurrent('Properties', () => {
|
|||
onSubmit={() => {}}
|
||||
/>);
|
||||
|
||||
propertyId = container.querySelector('#property-id');
|
||||
propertyParentId = container.querySelector('#property-parentId');
|
||||
propertyX = container.querySelector('#property-x');
|
||||
propertyY = container.querySelector('#property-y');
|
||||
propertyId = container.querySelector('#id');
|
||||
propertyParentId = container.querySelector('#parentId');
|
||||
propertyX = container.querySelector('#x');
|
||||
propertyY = container.querySelector('#y');
|
||||
expect(propertyId).toBeDefined();
|
||||
expect((propertyId as HTMLInputElement).value).toBe('stuffed');
|
||||
expect(propertyParentId).toBeDefined();
|
||||
|
|
|
@ -10,7 +10,7 @@ interface IPropertiesProps {
|
|||
}
|
||||
|
||||
export const Properties: React.FC<IPropertiesProps> = (props: IPropertiesProps) => {
|
||||
const [isDynamicInput, setIsDynamicInput] = useState<boolean>(false);
|
||||
const [isDynamicInput, setIsDynamicInput] = useState<boolean>(true);
|
||||
|
||||
if (props.properties === undefined) {
|
||||
return <div></div>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue