Skip to content

Commit

Permalink
Merge pull request udecode#382 from dylans/options-removerootlistitem
Browse files Browse the repository at this point in the history
verify list options passed via removeRootListItem codepath
  • Loading branch information
zbeyens authored Dec 9, 2020
2 parents 85d9acd + ff3a719 commit 064224d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,14 @@ describe('when there is toListItem sublist', () => {
const toListItem = getNodeById(editor, '11') as NodeEntry<Ancestor>;

if (fromListItem && toListItem) {
moveListItemSublistItemsToListItemSublist(editor, {
fromListItem,
toListItem,
});
moveListItemSublistItemsToListItemSublist(
editor,
{
fromListItem,
toListItem,
},
{}
);
}

expect(input.children).toEqual(output.children);
Expand Down Expand Up @@ -129,10 +133,14 @@ describe('when there is no list in toListItem', () => {
const toListItem = getNodeById(editor, '11') as NodeEntry<Ancestor>;

if (fromListItem && toListItem) {
moveListItemSublistItemsToListItemSublist(editor, {
fromListItem,
toListItem,
});
moveListItemSublistItemsToListItemSublist(
editor,
{
fromListItem,
toListItem,
},
{}
);
}

expect(input.children).toEqual(output.children);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const removeRootListItem = (
moveListItemSublistItemsToListItemSublist(editor, {
fromListItem: listItem,
toListItem: [previousListItemNode as Ancestor, previousListItemPath],
});
}, options);

// Select the P tag at the previous list item
Transforms.select(
Expand All @@ -57,7 +57,7 @@ export const removeRootListItem = (
fromListItem: listItem,
toList: list,
// start: true,
});
}, options);
}

// Remove the list-item
Expand Down

0 comments on commit 064224d

Please sign in to comment.