File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -298,6 +298,8 @@ angular.scenario.dsl('select', function() {
298298        option  =  select . find ( 'option:contains("'  +  value  +  '")' ) ; 
299299        if  ( option . length )  { 
300300          select . val ( option . val ( ) ) ; 
301+         }  else  { 
302+             return  done ( "option '"  +  value  +  "' not found" ) ; 
301303        } 
302304      } 
303305      select . trigger ( 'change' ) ; 
Original file line number Diff line number Diff line change @@ -269,6 +269,17 @@ describe("angular.scenario.dsl", function() {
269269        $root . dsl . select ( 'test' ) . options ( 'A' ,  'B' ) ; 
270270        expect ( $root . futureError ) . toMatch ( / d i d   n o t   m a t c h / ) ; 
271271      } ) ; 
272+       
273+       it ( 'should fail to select an option that does not exist' ,  function ( ) { 
274+           doc . append ( 
275+               '<select ng-model="test">'  + 
276+               '  <option value=A>one</option>'  + 
277+               '  <option value=B selected>two</option>'  + 
278+               '</select>' 
279+             ) ; 
280+             $root . dsl . select ( 'test' ) . option ( 'three' ) ; 
281+             expect ( $root . futureError ) . toMatch ( / n o t   f o u n d / ) ; 
282+       } ) ; 
272283    } ) ; 
273284
274285    describe ( 'Element' ,  function ( )  { 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments