Skip to content

Commit

Permalink
test: add a failing test for #76
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Lewis committed Dec 26, 2017
1 parent 71d5a05 commit da06674
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions test/resizable.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1402,8 +1402,6 @@ describe('resizable directive', () => {

it('should set the resize cursor on the body when resizing', () => {
const fixture: ComponentFixture<TestComponent> = createComponent();
fixture.componentInstance.enableGhostResize = false;
fixture.detectChanges();
const elm: HTMLElement =
fixture.componentInstance.resizable.elm.nativeElement;
triggerDomEvent('mousedown', elm, {
Expand All @@ -1421,4 +1419,29 @@ describe('resizable directive', () => {
});
expect(document.body.style.cursor).to.equal('');
});

it('should respect the css transform on the element', () => {
const fixture: ComponentFixture<TestComponent> = createComponent();
const elm: HTMLElement =
fixture.componentInstance.resizable.elm.nativeElement;
elm.style.transform = 'translate(10px, 20px)';
triggerDomEvent('mousedown', elm, {
clientX: 110,
clientY: 220
});
expect(fixture.componentInstance.resizeStart).to.have.been.calledWith({
edges: {
left: 0,
top: 0
},
rectangle: {
top: 200,
left: 100,
width: 300,
height: 150,
right: 400,
bottom: 350
}
});
});
});

0 comments on commit da06674

Please sign in to comment.