@@ -2246,16 +2246,16 @@ describe('calendarWeekView component', () => {
2246
2246
. add ( 18 , 'hours' )
2247
2247
. toDate ( ) ,
2248
2248
title : 'foo' ,
2249
- draggable : true
2250
- }
2249
+ draggable : true ,
2250
+ } ,
2251
2251
] ;
2252
2252
fixture . componentInstance . hourDuration = 40 ;
2253
2253
fixture . componentInstance . ngOnChanges ( {
2254
2254
viewDate : { } ,
2255
2255
events : { } ,
2256
2256
excludeDays : { } ,
2257
2257
daysInWeek : { } ,
2258
- hourColumns : { }
2258
+ hourColumns : { } ,
2259
2259
} ) ;
2260
2260
fixture . detectChanges ( ) ;
2261
2261
document . body . appendChild ( fixture . nativeElement ) ;
@@ -2265,24 +2265,24 @@ describe('calendarWeekView component', () => {
2265
2265
const dayWidth : number = events [ 0 ] . parentElement . offsetWidth ;
2266
2266
const rect1 : ClientRect = events [ 0 ] . getBoundingClientRect ( ) ;
2267
2267
let dragEvent : CalendarEventTimesChangedEvent ;
2268
- fixture . componentInstance . eventTimesChanged . pipe ( take ( 1 ) ) . subscribe ( e => {
2268
+ fixture . componentInstance . eventTimesChanged . pipe ( take ( 1 ) ) . subscribe ( ( e ) => {
2269
2269
dragEvent = e ;
2270
2270
} ) ;
2271
2271
triggerDomEvent ( 'mousedown' , events [ 0 ] , {
2272
2272
clientX : rect1 . right ,
2273
2273
clientY : rect1 . bottom ,
2274
- button : 0
2274
+ button : 0 ,
2275
2275
} ) ;
2276
2276
fixture . detectChanges ( ) ;
2277
2277
triggerDomEvent ( 'mousemove' , events [ 0 ] , {
2278
2278
clientX : rect1 . right + dayWidth - 5 ,
2279
- clientY : rect1 . bottom + 95
2279
+ clientY : rect1 . bottom + 95 ,
2280
2280
} ) ;
2281
2281
fixture . detectChanges ( ) ;
2282
2282
triggerDomEvent ( 'mouseup' , events [ 0 ] , {
2283
2283
clientX : rect1 . right + dayWidth - 5 ,
2284
2284
clientY : rect1 . bottom + 95 ,
2285
- button : 0
2285
+ button : 0 ,
2286
2286
} ) ;
2287
2287
fixture . detectChanges ( ) ;
2288
2288
fixture . destroy ( ) ;
@@ -2297,7 +2297,7 @@ describe('calendarWeekView component', () => {
2297
2297
newEnd : moment ( fixture . componentInstance . events [ 0 ] . end )
2298
2298
. add ( 3 , 'days' )
2299
2299
. add ( 1 , 'hour' )
2300
- . toDate ( )
2300
+ . toDate ( ) ,
2301
2301
} ) ;
2302
2302
} ) ;
2303
2303
@@ -2379,6 +2379,7 @@ describe('calendarWeekView component', () => {
2379
2379
} ,
2380
2380
} ,
2381
2381
] ;
2382
+ fixture . componentInstance . minimumEventHeight = 1 ;
2382
2383
fixture . componentInstance . hourSegmentHeight = 20 ;
2383
2384
fixture . componentInstance . ngOnChanges ( {
2384
2385
viewDate : { } ,
@@ -2441,17 +2442,18 @@ describe('calendarWeekView component', () => {
2441
2442
. toDate ( ) ,
2442
2443
title : 'foo' ,
2443
2444
resizable : {
2444
- afterEnd : true
2445
- }
2446
- }
2445
+ afterEnd : true ,
2446
+ } ,
2447
+ } ,
2447
2448
] ;
2448
2449
fixture . componentInstance . hourDuration = 40 ;
2450
+ fixture . componentInstance . minimumEventHeight = 1 ;
2449
2451
fixture . componentInstance . hourSegmentHeight = 20 ;
2450
2452
fixture . componentInstance . ngOnChanges ( {
2451
2453
viewDate : { } ,
2452
2454
events : { } ,
2453
2455
hourDuration : { } ,
2454
- hourSegmentHeight : { }
2456
+ hourSegmentHeight : { } ,
2455
2457
} ) ;
2456
2458
fixture . detectChanges ( ) ;
2457
2459
document . body . appendChild ( fixture . nativeElement ) ;
@@ -2461,25 +2463,25 @@ describe('calendarWeekView component', () => {
2461
2463
const rect : ClientRect = event . getBoundingClientRect ( ) ;
2462
2464
const resizeHandle = event . querySelector ( '.cal-resize-handle-after-end' ) ;
2463
2465
let resizeEvent : CalendarEventTimesChangedEvent ;
2464
- fixture . componentInstance . eventTimesChanged . pipe ( take ( 1 ) ) . subscribe ( e => {
2466
+ fixture . componentInstance . eventTimesChanged . pipe ( take ( 1 ) ) . subscribe ( ( e ) => {
2465
2467
resizeEvent = e ;
2466
2468
} ) ;
2467
2469
triggerDomEvent ( 'mousedown' , resizeHandle , {
2468
2470
clientX : rect . right ,
2469
2471
clientY : rect . bottom ,
2470
- button : 0
2472
+ button : 0 ,
2471
2473
} ) ;
2472
2474
fixture . detectChanges ( ) ;
2473
2475
triggerDomEvent ( 'mousemove' , document . body , {
2474
2476
clientX : rect . right ,
2475
- clientY : rect . bottom - 120
2477
+ clientY : rect . bottom - 120 ,
2476
2478
} ) ;
2477
2479
fixture . detectChanges ( ) ;
2478
2480
expect ( event . getBoundingClientRect ( ) . height ) . to . equal ( 20 ) ;
2479
2481
triggerDomEvent ( 'mouseup' , document . body , {
2480
2482
clientX : rect . right ,
2481
2483
clientY : rect . bottom - 120 ,
2482
- button : 0
2484
+ button : 0 ,
2483
2485
} ) ;
2484
2486
fixture . detectChanges ( ) ;
2485
2487
expect ( resizeEvent ) . to . deep . equal ( {
@@ -2488,7 +2490,7 @@ describe('calendarWeekView component', () => {
2488
2490
newStart : fixture . componentInstance . events [ 0 ] . start ,
2489
2491
newEnd : moment ( fixture . componentInstance . events [ 0 ] . start )
2490
2492
. add ( 20 , 'minutes' )
2491
- . toDate ( )
2493
+ . toDate ( ) ,
2492
2494
} ) ;
2493
2495
} ) ;
2494
2496
@@ -2632,6 +2634,24 @@ describe('calendarWeekView component', () => {
2632
2634
expect ( updatedEvent1 . innerText ) . to . equal ( '4:30 - 6:30' ) ;
2633
2635
} ) ;
2634
2636
2637
+ it ( 'should set a minimum event height' , ( ) => {
2638
+ const fixture = TestBed . createComponent ( CalendarWeekViewComponent ) ;
2639
+ fixture . componentInstance . viewDate = moment ( ) . startOf ( 'week' ) . toDate ( ) ;
2640
+ fixture . componentInstance . events = [
2641
+ {
2642
+ start : moment ( ) . startOf ( 'week' ) . toDate ( ) ,
2643
+ end : moment ( ) . startOf ( 'week' ) . add ( 5 , 'minutes' ) . toDate ( ) ,
2644
+ title : 'foo' ,
2645
+ } ,
2646
+ ] ;
2647
+ fixture . componentInstance . ngOnChanges ( { viewDate : { } , events : { } } ) ;
2648
+ fixture . detectChanges ( ) ;
2649
+ expect (
2650
+ fixture . nativeElement . querySelector ( '.cal-event-container' ) . offsetHeight
2651
+ ) . to . equal ( 30 ) ;
2652
+ fixture . destroy ( ) ;
2653
+ } ) ;
2654
+
2635
2655
describe ( 'current time marker' , ( ) => {
2636
2656
let clock : any ;
2637
2657
beforeEach ( ( ) => {
0 commit comments