@@ -456,71 +456,6 @@ describe('uiStateRef', function() {
456
456
} ) ) ;
457
457
} ) ;
458
458
459
- describe ( 'links with dyna mic state definitions' , function ( ) {
460
- var template ;
461
-
462
- beforeEach ( inject ( function ( $rootScope , $compile , $state ) {
463
- el = angular . element ( '<a ui-state="state" ui-state-params="params">state</a>' ) ;
464
- scope = $rootScope ;
465
- angular . extend ( scope , { state : 'contacts' , params : { } } ) ;
466
- template = $compile ( el ) ( scope ) ;
467
- scope . $digest ( ) ;
468
- } ) ) ;
469
-
470
- it ( 'sets the correct initial href' , function ( ) {
471
- expect ( angular . element ( template [ 0 ] ) . attr ( 'href' ) ) . toBe ( '#/contacts' ) ;
472
- } ) ;
473
-
474
- it ( 'updates to the new href' , function ( ) {
475
- expect ( angular . element ( template [ 0 ] ) . attr ( 'href' ) ) . toBe ( '#/contacts' ) ;
476
-
477
- scope . state = 'contacts.item' ;
478
- scope . params = { id : 5 } ;
479
- scope . $digest ( ) ;
480
- expect ( angular . element ( template [ 0 ] ) . attr ( 'href' ) ) . toBe ( '#/contacts/5' ) ;
481
-
482
- scope . params . id = 25 ;
483
- scope . $digest ( ) ;
484
- expect ( angular . element ( template [ 0 ] ) . attr ( 'href' ) ) . toBe ( '#/contacts/25' ) ;
485
- } ) ;
486
-
487
- it ( 'retains the old href if the new points to a non-state' , function ( ) {
488
- expect ( angular . element ( template [ 0 ] ) . attr ( 'href' ) ) . toBe ( '#/contacts' ) ;
489
- scope . state = 'nostate' ;
490
- scope . $digest ( ) ;
491
- expect ( angular . element ( template [ 0 ] ) . attr ( 'href' ) ) . toBe ( '#/contacts' ) ;
492
- } ) ;
493
-
494
- it ( 'accepts param overrides' , inject ( function ( $compile ) {
495
- el = angular . element ( '<a ui-state="state" ui-state-params="params">state</a>' ) ;
496
- scope . state = 'contacts.item' ;
497
- scope . params = { id : 10 } ;
498
- template = $compile ( el ) ( scope ) ;
499
- scope . $digest ( ) ;
500
- expect ( angular . element ( template [ 0 ] ) . attr ( 'href' ) ) . toBe ( '#/contacts/10' ) ;
501
- } ) ) ;
502
-
503
- it ( 'accepts option overrides' , inject ( function ( $compile , $timeout , $state ) {
504
- var transitionOptions ;
505
-
506
- el = angular . element ( '<a ui-state="state" ui-state-opts="opts">state</a>' ) ;
507
- scope . state = 'contacts' ;
508
- scope . opts = { reload : true } ;
509
- template = $compile ( el ) ( scope ) ;
510
- scope . $digest ( ) ;
511
-
512
- spyOn ( $state , 'go' ) . and . callFake ( function ( state , params , options ) {
513
- transitionOptions = options ;
514
- } ) ;
515
-
516
- triggerClick ( template )
517
- $timeout . flush ( ) ;
518
-
519
- expect ( transitionOptions . reload ) . toEqual ( true ) ;
520
- expect ( transitionOptions . absolute ) . toBeUndefined ( ) ;
521
- } ) ) ;
522
- } ) ;
523
-
524
459
describe ( 'forms' , function ( ) {
525
460
var el , scope ;
526
461
0 commit comments