File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
src/components/tile-manager Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff 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} ) ;
You can’t perform that action at this time.
0 commit comments