@@ -20,14 +20,28 @@ test('it fires "didResize" when the window is resized', function(assert) {
2020 let evt = new window . Event ( 'resize' ) ;
2121
2222 window . dispatchEvent ( evt ) ;
23- assert . equal ( didResizeCallCount , 1 , 'didResize called 1 time on event firing' ) ;
23+ assert . equal ( didResizeCallCount , 0 , 'didResize called 0 time on event firing' ) ;
2424 service . incrementProperty ( '_oldHeight' , - 20 ) ;
2525 window . dispatchEvent ( evt ) ;
26- assert . equal ( didResizeCallCount , 2 , 'didResize called another time on event firing again ' ) ;
26+ assert . equal ( didResizeCallCount , 1 , 'didResize called 1 time on event firing' ) ;
2727 service . set ( 'heightSensitive' , false ) ;
2828 service . incrementProperty ( '_oldHeight' , - 20 ) ;
2929 window . dispatchEvent ( evt ) ;
30- assert . equal ( didResizeCallCount , 2 , 'didResize shouldn\'t be called again if heightSensitive is false' ) ;
30+ assert . equal ( didResizeCallCount , 1 , 'didResize shouldn\'t be called again if heightSensitive is false' ) ;
31+
32+ } ) ;
33+
34+ test ( 'screenHeight is bound to the non debounced resize' , function ( assert ) {
35+
36+ let service = this . subject ( {
37+ widthSensitive : false ,
38+ heightSensitive : true
39+ } ) ;
40+
41+ let evt = new window . Event ( 'resize' ) ;
42+
43+ window . dispatchEvent ( evt ) ;
44+ assert . equal ( service . get ( 'screenHeight' ) , window . innerHeight ) ;
3145
3246} ) ;
3347
@@ -55,6 +69,7 @@ test('it fires "debouncedDidResize" when the window is resized', function(asser
5569 later ( triggerEvent , 10 ) ;
5670 }
5771
72+ service . incrementProperty ( '_oldHeightDebounced' , - 20 ) ;
5873 assert . equal ( debouncedDidResizeCallCount , 0 , 'debouncedDidResize not called yet' ) ;
5974 later ( ( ) => {
6075 assert . equal ( debouncedDidResizeCallCount , 1 , 'debouncedDidResize called 1 time after 500ms' ) ;
0 commit comments