Skip to content

Commit

Permalink
add new props to dnd test
Browse files Browse the repository at this point in the history
  • Loading branch information
Georges-GNM committed Jan 29, 2025
1 parent 4a030f0 commit 562054c
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions fronts-client/src/lib/dnd/__tests__/dnd.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,15 @@ describe('Curation', () => {
expect(edit).toEqual({
data: { id: '1' },
from: { type: 'b', id: '0', index: 0 },
to: { type: 'a', id: '2', index: 1 },
to: {
cards: [{ id: '3' }, { id: '4' }],
groupName: undefined,
groupsIds: undefined,
id: '2',
index: 1,
numberOfCardsInGroup: undefined,
type: 'a',
},
});
});

Expand Down Expand Up @@ -164,7 +172,15 @@ describe('Curation', () => {
expect(edit).toEqual({
data: { id: '1' },
from: { type: 'b', id: '0', index: 0 },
to: { type: 'a', id: '2', index: 0 },
to: {
cards: [{ id: '3' }, { id: '4' }],
groupName: undefined,
groupsIds: undefined,
id: '2',
index: 0,
numberOfCardsInGroup: undefined,
type: 'a',
},
});

runDrag(nodeProps)(dropProps, false);
Expand Down Expand Up @@ -273,7 +289,15 @@ describe('Curation', () => {
})(dropProps);

expect(JSON.parse(event.dataTransfer.getData('text'))).toEqual(data);
expect(to).toEqual({ id: '2', index: 1, type: 'a' });
expect(to).toEqual({
cards: [{ id: '1' }],
groupName: undefined,
groupsIds: undefined,
id: '2',
index: 1,
numberOfCardsInGroup: undefined,
type: 'a',
});
});

it('does not allow moves of a node to a subPath of that node', () => {
Expand Down

0 comments on commit 562054c

Please sign in to comment.