@@ -6,7 +6,8 @@ describe('isState filter', function() {
66 beforeEach ( module ( function ( $stateProvider ) {
77 $stateProvider
88 . state ( 'a' , { url : '/' } )
9- . state ( 'a.b' , { url : '/b' } ) ;
9+ . state ( 'a.b' , { url : '/b' } )
10+ . state ( 'with-param' , { url : '/with/:param' } ) ;
1011 } ) ) ;
1112
1213 it ( 'should return true if the current state exactly matches the input state' , inject ( function ( $parse , $state , $q , $rootScope ) {
@@ -20,6 +21,18 @@ describe('isState filter', function() {
2021 $q . flush ( ) ;
2122 expect ( $parse ( '"a" | isState' ) ( $rootScope ) ) . toBe ( false ) ;
2223 } ) ) ;
24+
25+ it ( 'should return true if the current state and param matches the input state' , inject ( function ( $parse , $state , $q , $rootScope ) {
26+ $state . go ( 'with-param' , { param : 'a' } ) ;
27+ $q . flush ( ) ;
28+ expect ( $parse ( '"with-param" | isState: {param: "a"}' ) ( $rootScope ) ) . toBe ( true ) ;
29+ } ) ) ;
30+
31+ it ( 'should return false if the current state and param does not match the input state' , inject ( function ( $parse , $state , $q , $rootScope ) {
32+ $state . go ( 'with-param' , { param : 'b' } ) ;
33+ $q . flush ( ) ;
34+ expect ( $parse ( '"with-param" | isState: {param: "a"}' ) ( $rootScope ) ) . toBe ( false ) ;
35+ } ) ) ;
2336} ) ;
2437
2538describe ( 'includedByState filter' , function ( ) {
0 commit comments