@@ -1294,26 +1294,31 @@ describe('datepicker directive', function () {
1294
1294
} ) ;
1295
1295
} ) ;
1296
1296
} ) ;
1297
- } ) ;
1298
1297
1299
- describe ( 'datepicker directive with empty initial state' , function ( ) {
1300
- var $rootScope , element ;
1301
- beforeEach ( module ( 'ui.bootstrap.datepicker' ) ) ;
1302
- beforeEach ( module ( 'template/datepicker/datepicker.html' ) ) ;
1303
- beforeEach ( inject ( function ( _$compile_ , _$rootScope_ ) {
1304
- $compile = _$compile_ ;
1305
- $rootScope = _$rootScope_ ;
1306
- $rootScope . date = null ;
1307
- element = $compile ( '<datepicker ng-model="$parent.date"></datepicker>' ) ( $rootScope ) ;
1308
- $rootScope . $digest ( ) ;
1309
- } ) ) ;
1298
+ describe ( 'datepicker directive with empty initial state' , function ( ) {
1299
+ beforeEach ( inject ( function ( ) {
1300
+ $rootScope . date = null ;
1301
+ element = $compile ( '<datepicker ng-model="$parent.date"></datepicker>' ) ( $rootScope ) ;
1302
+ $rootScope . $digest ( ) ;
1303
+ } ) ) ;
1310
1304
1311
- it ( 'is a `<table>` element' , function ( ) {
1312
- expect ( element . prop ( 'tagName' ) ) . toBe ( 'TABLE' ) ;
1313
- expect ( element . find ( 'thead' ) . find ( 'tr' ) . length ) . toBe ( 2 ) ;
1314
- } ) ;
1305
+ it ( 'is a `<table>` element' , function ( ) {
1306
+ expect ( element . prop ( 'tagName' ) ) . toBe ( 'TABLE' ) ;
1307
+ expect ( element . find ( 'thead' ) . find ( 'tr' ) . length ) . toBe ( 2 ) ;
1308
+ } ) ;
1315
1309
1316
- it ( 'is shows rows with days' , function ( ) {
1317
- expect ( element . find ( 'tbody' ) . find ( 'tr' ) . length ) . toBeGreaterThan ( 3 ) ;
1310
+ it ( 'is shows rows with days' , function ( ) {
1311
+ expect ( element . find ( 'tbody' ) . find ( 'tr' ) . length ) . toBeGreaterThan ( 3 ) ;
1312
+ } ) ;
1313
+
1314
+ it ( 'sets default 00:00:00 time for selected date' , function ( ) {
1315
+ $rootScope . date = new Date ( 'August 1, 2013' ) ;
1316
+ $rootScope . $digest ( ) ;
1317
+ $rootScope . date = null ;
1318
+ $rootScope . $digest ( ) ;
1319
+
1320
+ clickOption ( 2 , 0 ) ;
1321
+ expect ( $rootScope . date ) . toEqual ( new Date ( 'August 11, 2013 00:00:00' ) ) ;
1322
+ } ) ;
1318
1323
} ) ;
1319
1324
} ) ;
0 commit comments