@@ -3,7 +3,8 @@ describe('isState filter', function() {
33 beforeEach ( module ( function ( $stateProvider ) {
44 $stateProvider
55 . state ( 'a' , { url : '/' } )
6- . state ( 'a.b' , { url : '/b' } ) ;
6+ . state ( 'a.b' , { url : '/b' } )
7+ . state ( 'with-param' , { url : '/with/:param' } ) ;
78 } ) ) ;
89
910 it ( 'should return true if the current state exactly matches the input state' , inject ( function ( $parse , $state , $q , $rootScope ) {
@@ -17,6 +18,18 @@ describe('isState filter', function() {
1718 $q . flush ( ) ;
1819 expect ( $parse ( '"a" | isState' ) ( $rootScope ) ) . toBe ( false ) ;
1920 } ) ) ;
21+
22+ it ( 'should return true if the current state and param matches the input state' , inject ( function ( $parse , $state , $q , $rootScope ) {
23+ $state . go ( 'with-param' , { param : 'a' } ) ;
24+ $q . flush ( ) ;
25+ expect ( $parse ( '"with-param" | isState: {param: "a"}' ) ( $rootScope ) ) . toBe ( true ) ;
26+ } ) ) ;
27+
28+ it ( 'should return false if the current state and param does not match the input state' , inject ( function ( $parse , $state , $q , $rootScope ) {
29+ $state . go ( 'with-param' , { param : 'b' } ) ;
30+ $q . flush ( ) ;
31+ expect ( $parse ( '"with-param" | isState: {param: "a"}' ) ( $rootScope ) ) . toBe ( false ) ;
32+ } ) ) ;
2033} ) ;
2134
2235describe ( 'includedByState filter' , function ( ) {
0 commit comments