@@ -2343,10 +2343,10 @@ describe('datepicker', function() {
2343
2343
describe ( 'datepickerPopupConfig.altInputFormats' , function ( ) {
2344
2344
var originalConfig = { } ;
2345
2345
beforeEach ( inject ( function ( uibDatepickerPopupConfig ) {
2346
+ $rootScope . date = new Date ( 'November 9, 1980' ) ;
2346
2347
angular . extend ( originalConfig , uibDatepickerPopupConfig ) ;
2347
2348
uibDatepickerPopupConfig . datepickerPopup = 'MM-dd-yyyy' ;
2348
2349
uibDatepickerPopupConfig . altInputFormats = [ 'M!/d!/yyyy' ] ;
2349
-
2350
2350
var wrapElement = $compile ( '<div><input ng-model="date" uib-datepicker-popup is-open="true"></div>' ) ( $rootScope ) ;
2351
2351
$rootScope . $digest ( ) ;
2352
2352
assignElements ( wrapElement ) ;
@@ -2364,6 +2364,12 @@ describe('datepicker', function() {
2364
2364
expect ( $rootScope . date . getMonth ( ) ) . toEqual ( 10 ) ;
2365
2365
expect ( $rootScope . date . getDate ( ) ) . toEqual ( 8 ) ;
2366
2366
} ) ;
2367
+
2368
+ it ( 'changes the datepicker' , function ( ) {
2369
+ expect ( selectedElementIndex ( ) ) . toEqual ( 14 ) ;
2370
+ changeInputValueTo ( inputEl , '11/8/1980' ) ;
2371
+ expect ( selectedElementIndex ( ) ) . toEqual ( 13 ) ;
2372
+ } ) ;
2367
2373
} ) ;
2368
2374
2369
2375
describe ( 'attribute `alt-input-formats`' , function ( ) {
@@ -2381,6 +2387,12 @@ describe('datepicker', function() {
2381
2387
expect ( $rootScope . date . getMonth ( ) ) . toEqual ( 10 ) ;
2382
2388
expect ( $rootScope . date . getDate ( ) ) . toEqual ( 8 ) ;
2383
2389
} ) ;
2390
+
2391
+ it ( 'changes the datepicker' , function ( ) {
2392
+ expect ( selectedElementIndex ( ) ) . toEqual ( 14 ) ;
2393
+ changeInputValueTo ( inputEl , '11/8/1980' ) ;
2394
+ expect ( selectedElementIndex ( ) ) . toEqual ( 13 ) ;
2395
+ } ) ;
2384
2396
} ) ;
2385
2397
} ) ;
2386
2398
0 commit comments