Skip to content

Commit 5928417

Browse files
committed
chore: add test that checks resizing part
1 parent 19d6dfe commit 5928417

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/components/tile-manager/tile-resize.spec.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,5 +204,27 @@ describe('Tile resize', () => {
204204

205205
expect(tileDOM.resizeElement).to.not.exist;
206206
});
207+
208+
it('should update tile parts on resizing', async () => {
209+
const tile = first(getTiles());
210+
const tileDOM = getTileDOM(tile);
211+
const tileRect = tile.getBoundingClientRect();
212+
const eventSpy = spy(tileDOM.resizeElement, 'emitEvent');
213+
214+
simulatePointerDown(tileDOM.resizeTrigger);
215+
await elementUpdated(tileDOM.resizeElement);
216+
217+
expect(tile.getAttribute('part')).to.be.null;
218+
expect(eventSpy).calledWith('igcResizeStart');
219+
220+
simulatePointerMove(tileDOM.resizeTrigger, {
221+
clientX: (tileRect.x + tileRect.width) * 2,
222+
clientY: (tileRect.y + tileRect.height) * 2,
223+
});
224+
await elementUpdated(tileDOM.resizeElement);
225+
226+
expect(eventSpy).calledWith('igcResize');
227+
expect(tile.getAttribute('part')).to.include('resizing');
228+
});
207229
});
208230
});

0 commit comments

Comments
 (0)