Skip to content

Commit

Permalink
Updated types for DraggableStateSnapshot in 2 files.
Browse files Browse the repository at this point in the history
  • Loading branch information
1Copenut committed Aug 10, 2023
1 parent d8d1a41 commit 3f3e0bb
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -355,13 +355,31 @@ const DraggableWrapperComponent: React.FC<Props> = ({
>
{truncate ? (
<TruncatableText data-test-subj="render-truncatable-content">
{render(dataProvider, null, { isDragging: false, isDropAnimating: false })}
{render(dataProvider, null, {
isDragging: false,
isDropAnimating: false,
isClone: false,
dropAnimation: null,
draggingOver: null,
combineWith: null,
combineTargetFor: null,
mode: null,
})}
</TruncatableText>
) : (
<ProviderContentWrapper
data-test-subj={`render-content-${dataProvider.queryMatch.field}`}
>
{render(dataProvider, null, { isDragging: false, isDropAnimating: false })}
{render(dataProvider, null, {
isDragging: false,
isDropAnimating: false,
isClone: false,
dropAnimation: null,
draggingOver: null,
combineWith: null,
combineTargetFor: null,
mode: null,
})}
</ProviderContentWrapper>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ describe('helpers', () => {
});

describe('isValidDestination', () => {
test('it returns false when destination is undefined', () => {
expect(isValidDestination(undefined)).toBe(false);
test('it returns false when destination is null', () => {
expect(isValidDestination(null)).toBe(false);
});

test('it returns true when the type guard matches as DraggableLocation ', () => {
Expand Down Expand Up @@ -861,7 +861,7 @@ describe('helpers', () => {

addProviderToGroup({
dataProviders,
destination: undefined,
destination: null,
dispatch,
onAddedToTimeline,
providerToAdd,
Expand All @@ -877,7 +877,7 @@ describe('helpers', () => {

addProviderToGroup({
dataProviders,
destination: undefined,
destination: null,
dispatch,
onAddedToTimeline,
providerToAdd,
Expand Down

0 comments on commit 3f3e0bb

Please sign in to comment.