Skip to content

Commit 8f5a30a

Browse files
author
Timon Krebs
committed
feat(cdk/drag-drop): fixed tests
1 parent 5164406 commit 8f5a30a

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/cdk/drag-drop/directives/drag.spec.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,8 @@ describe('CdkDrag', () => {
376376
// go into an infinite loop trying to stringify the event, if the test fails.
377377
expect(event).toEqual({
378378
source: fixture.componentInstance.dragInstance,
379-
distance: {x: jasmine.any(Number), y: jasmine.any(Number)}
379+
distance: {x: jasmine.any(Number), y: jasmine.any(Number)},
380+
dropPosition: {x: jasmine.any(Number), y: jasmine.any(Number)}
380381
});
381382
}));
382383

@@ -389,15 +390,17 @@ describe('CdkDrag', () => {
389390

390391
expect(event).toEqual({
391392
source: jasmine.anything(),
392-
distance: {x: 25, y: 30}
393+
distance: {x: 25, y: 30},
394+
dropPosition: {x: 25, y: 30}
393395
});
394396

395397
dragElementViaMouse(fixture, fixture.componentInstance.dragElement.nativeElement, 40, 50);
396398
event = fixture.componentInstance.endedSpy.calls.mostRecent().args[0];
397399

398400
expect(event).toEqual({
399401
source: jasmine.anything(),
400-
distance: {x: 40, y: 50}
402+
distance: {x: 40, y: 50},
403+
dropPosition: {x: 40, y: 50}
401404
});
402405
}));
403406

src/cdk/drag-drop/directives/drag.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ export class CdkDrag<T = any> implements AfterViewInit, OnChanges, OnDestroy {
460460

461461
ref.ended.subscribe(event => {
462462
this.ended.emit({
463-
source: this,
463+
source: this,
464464
distance: event.distance,
465465
dropPosition: event.dropPosition
466466
});

tools/public_api_guard/cdk/drag-drop.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ export declare class DragRef<T = any> {
283283
ended: Subject<{
284284
source: DragRef;
285285
distance: Point;
286+
dropPosition: Point;
286287
}>;
287288
entered: Subject<{
288289
container: DropListRef;

0 commit comments

Comments
 (0)