@@ -659,14 +659,14 @@ describe("my app", function() {
659659 util . executeScript ( scope + ".combo.value1 = 2;" ) ;
660660 util . executeScript ( scope + ".$apply();" ) ;
661661 expect ( util . getResult ( combo + '.igCombo("value")' ) ) . toBe ( 2 ) ;
662- expect ( util . getResult ( '$("#combo1").val()' ) ) . toBe ( "Chang" ) ;
662+ expect ( util . getResult ( '$("#combo1").igCombo("textInput"). val()' ) ) . toBe ( "Chang" ) ;
663663 util . executeScript ( '$("input[ng-model=\'combo.value1\']:eq(0)").val("5").trigger("input");' ) ;
664- expect ( util . getResult ( '$("#combo1").val()' ) ) . toBe ( "Chef Anton's Gumbo Mix" ) ;
664+ expect ( util . getResult ( '$("#combo1").igCombo("textInput"). val()' ) ) . toBe ( "Chef Anton's Gumbo Mix" ) ;
665665
666666 util . executeScript ( scope + ".combo.value2 = [1];" ) ;
667667 util . executeScript ( scope + ".$apply();" ) ;
668668 expect ( util . getResult ( combo2 + '.igCombo("value")[0]' ) ) . toBe ( 1 ) ;
669- expect ( util . getResult ( '$("#combo2").val()' ) ) . toBe ( "Chai" ) ;
669+ expect ( util . getResult ( '$("#combo2").igCombo("textInput"). val()' ) ) . toBe ( "Chai" ) ;
670670 } ) ;
671671
672672 it ( "should set model on clear" , function ( ) {
@@ -682,17 +682,17 @@ describe("my app", function() {
682682 } ) ;
683683
684684 it ( "should update model on change of combo input" , function ( ) {
685- util . executeScript ( combo + ".focus();" ) ;
685+ util . executeScript ( combo + ".igCombo('textInput'). focus();" ) ;
686686 //check scope value remains unchanged during search entry
687- expect ( util . getResult ( 'typeInInputWrap("Chang", ' + combo + ', "combo.value1");' ) ) . toBe ( false ) ;
687+ expect ( util . getResult ( 'typeInInputWrap("Chang", ' + combo3 + '.igCombo("textInput")' + ', "combo.value1");' ) ) . toBe ( false ) ;
688688 // wait for sleep resolve:
689689 expect ( browser . driver . sleep ( 250 ) ) . toBe ( undefined ) ; //util.getResult(combo + '.igCombo("option", "delayInputChangeProcessing");')
690690 expect ( util . getResult ( scope + ".combo.value1" ) ) . toBe ( 2 ) ;
691691 } ) ;
692692
693693 it ( "should update combo value when allowCustomValue is true" , function ( ) {
694- util . executeScript ( combo3 + ".focus();" ) ;
695- expect ( util . getResult ( 'typeInInputWrap("customValue1", ' + combo3 + ', "combo.value1");' ) ) . toBe ( false ) ;
694+ util . executeScript ( combo3 + ".igCombo('textInput'). focus();" ) ;
695+ expect ( util . getResult ( 'typeInInputWrap("customValue1", ' + combo3 + '.igCombo("textInput")' + ' , "combo.value1");') ) . toBe ( false ) ;
696696 expect ( browser . driver . sleep ( 250 ) ) . toBe ( undefined ) ;
697697 util . executeScript ( combo3 + ".igCombo('comboWrapper').find('.ui-igcombo-button').click();" ) ;
698698 expect ( util . getResult ( combo3 + '.igCombo("value")[0]' ) ) . toBe ( "customValue1" ) ;
@@ -702,7 +702,12 @@ describe("my app", function() {
702702 util . executeScript ( scope + ".northwind = [{'ProductID': 21, 'ProductName': 'Strawberry'}];" ) ;
703703 util . executeScript ( scope + ".combo.value2 = [21];" ) ;
704704 util . executeScript ( scope + ".$apply();" ) ;
705- expect ( util . getResult ( '$("#combo2").val()' ) ) . toBe ( "Strawberry" ) ;
705+ expect ( util . getResult ( '$("#combo2").igCombo("textInput").val()' ) ) . toBe ( "Strawberry" ) ;
706+ } ) ;
707+
708+ it ( "should set model on clear when allowCustomValue is true" , function ( ) {
709+ util . executeScript ( combo3 + ".igCombo('comboWrapper').find('.ui-igcombo-clear').click();" ) ;
710+ expect ( util . getResult ( scope + ".combo.value1.length" ) ) . toBe ( 0 ) ;
706711 } ) ;
707712 } ) ;
708713
0 commit comments