Skip to content

Commit

Permalink
fix(ui): failing test cases for form manip utils
Browse files Browse the repository at this point in the history
  • Loading branch information
psychedelicious committed Feb 19, 2025
1 parent c3bdfd9 commit 0000373
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ describe('workflow builder form manipulation', () => {
index: 0,
});

expect(getElement(form, el.id, isContainerElement).parentId).toBe(form.rootElementId);
expect(getElement(form, el.id).parentId).toBe(form.rootElementId);
});

it('should add the element at the given index', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ export const addElement = (args: {
const { form, element, parentId, index } = args;
const { elements } = form;

if (element.id in elements) {
// Element already exists
return false;
}

const parent = elements[parentId];
if (!parent || !isContainerElement(parent)) {
return false;
Expand Down

0 comments on commit 0000373

Please sign in to comment.