@@ -174,34 +174,6 @@ BinderTest.prototype.testButtonElementActionExecutesInScope = function(){
174174 assertTrue ( savedCalled ) ;
175175} ;
176176
177- BinderTest . prototype . XtestParseEmptyAnchor = function ( ) {
178- var binder = this . compile ( "<div/>" ) . binder ;
179- var location = binder . location ;
180- var anchor = binder . anchor ;
181- location . url = "a#x=1" ;
182- binder . parseAnchor ( ) ;
183- assertEquals ( 1 , binder . anchor . x ) ;
184- location . url = "a#" ;
185- binder . parseAnchor ( ) ;
186- assertTrue ( "old values did not get removed" , ! binder . anchor . x ) ;
187- assertTrue ( "anchor gor replaced" , anchor === binder . anchor ) ;
188- assertEquals ( 'undefined' , typeof ( anchor [ "" ] ) ) ;
189- } ;
190-
191- BinderTest . prototype . XtestParseAnchor = function ( ) {
192- var binder = this . compile ( "<div/>" ) . binder ;
193- var location = binder . location ;
194- location . url = "a#x=1" ;
195- binder . parseAnchor ( ) ;
196- assertEquals ( binder . anchor . x , "1" ) ;
197- location . url = "a#a=b&c=%20&d" ;
198- binder . parseAnchor ( ) ;
199- assertEquals ( binder . anchor . a , 'b' ) ;
200- assertEquals ( binder . anchor . c , ' ' ) ;
201- assertTrue ( binder . anchor . d !== null ) ;
202- assertTrue ( ! binder . anchor . x ) ;
203- } ;
204-
205177BinderTest . prototype . testRepeaterUpdateBindings = function ( ) {
206178 var a = this . compile ( '<ul><LI ng-repeat="item in model.items" ng-bind="item.a"/></ul>' ) ;
207179 var form = a . node ;
@@ -355,18 +327,6 @@ BinderTest.prototype.testNestedRepeater = function() {
355327 '</div></div>' , sortedHtml ( a . node ) ) ;
356328} ;
357329
358- BinderTest . prototype . XtestRadioButtonGetsPrefixed = function ( ) {
359- var a = this . compile ( '<div><input ng-repeat="m in model" type="radio" name="m.a" value="on"/></div>' ) ;
360- a . scope . $set ( 'model' , [ 'a1' , 'a2' ] ) ;
361- a . scope . $eval ( ) ;
362-
363- assertEquals ( '</div>' +
364- '<#comment></#comment>' +
365- '<input name="0:m.a" ng-repeat-index="0" type="radio" value="on"></input>' +
366- '<input name="1:m.a" ng-repeat-index="1" type="radio" value="on"></input></div>' ,
367- sortedHtml ( a . node ) ) ;
368- } ;
369-
370330BinderTest . prototype . testHideBindingExpression = function ( ) {
371331 var a = this . compile ( '<div ng-hide="hidden == 3"/>' ) ;
372332
@@ -525,31 +485,6 @@ BinderTest.prototype.testShouldTemplateBindPreElements = function () {
525485 assertEquals ( '<pre ng-bind-template="Hello {{name}}!">Hello World!</pre>' , sortedHtml ( c . node ) ) ;
526486} ;
527487
528- BinderTest . prototype . XtestDissableAutoSubmit = function ( ) {
529- var c = this . compile ( '<input type="submit" value="S"/>' , null , { autoSubmit :true } ) ;
530- assertEquals (
531- '<input ng-action="$save()" ng-bind-attr="{"disabled":"{{$invalidWidgets}}"}" type="submit" value="S"></input>' ,
532- sortedHtml ( c . node ) ) ;
533-
534- c = this . compile ( '<input type="submit" value="S"/>' , null , { autoSubmit :false } ) ;
535- assertEquals (
536- '<input type="submit" value="S"></input>' ,
537- sortedHtml ( c . node ) ) ;
538- } ;
539-
540- BinderTest . prototype . XtestSettingAnchorToNullOrUndefinedRemovesTheAnchorFromURL = function ( ) {
541- var c = this . compile ( '' ) ;
542- c . binder . location . set ( "http://server/#a=1&b=2" ) ;
543- c . binder . parseAnchor ( ) ;
544- assertEquals ( '1' , c . binder . anchor . a ) ;
545- assertEquals ( '2' , c . binder . anchor . b ) ;
546-
547- c . binder . anchor . a = null ;
548- c . binder . anchor . b = null ;
549- c . binder . updateAnchor ( ) ;
550- assertEquals ( 'http://server/#' , c . binder . location . get ( ) ) ;
551- } ;
552-
553488BinderTest . prototype . testFillInOptionValueWhenMissing = function ( ) {
554489 var c = this . compile (
555490 '<select><option selected="true">{{a}}</option><option value="">{{b}}</option><option>C</option></select>' ) ;
@@ -570,9 +505,11 @@ BinderTest.prototype.testFillInOptionValueWhenMissing = function() {
570505 expect ( optionC . text ( ) ) . toEqual ( 'C' ) ;
571506} ;
572507
573- BinderTest . prototype . XtestValidateForm = function ( ) {
574- var c = this . compile ( '<input name="name" ng-required>' +
575- '<div ng-repeat="item in items"><input name="item.name" ng-required/></div>' ) ;
508+ BinderTest . prototype . testValidateForm = function ( ) {
509+ var doc = jqLite ( document . body ) ;
510+ doc . append ( '<div><input name="name" ng-required>' +
511+ '<div ng-repeat="item in items"><input name="item.name" ng-required/></div></div>' ) ;
512+ var c = this . compile ( doc ) ;
576513 var items = [ { } , { } ] ;
577514 c . scope . $set ( "items" , items ) ;
578515 c . scope . $eval ( ) ;
@@ -599,8 +536,9 @@ BinderTest.prototype.XtestValidateForm = function() {
599536 assertEquals ( 0 , c . scope . $get ( "$invalidWidgets.length" ) ) ;
600537} ;
601538
602- BinderTest . prototype . XtestValidateOnlyVisibleItems = function ( ) {
603- var c = this . compile ( '<input name="name" ng-required><input ng-show="show" name="name" ng-required>' ) ;
539+ BinderTest . prototype . testValidateOnlyVisibleItems = function ( ) {
540+ var c = this . compile ( '<div><input name="name" ng-required><input ng-show="show" name="name" ng-required></div>' ) ;
541+ jqLite ( document . body ) . append ( c . node ) ;
604542 c . scope . $set ( "show" , true ) ;
605543 c . scope . $eval ( ) ;
606544 assertEquals ( 2 , c . scope . $get ( "$invalidWidgets.length" ) ) ;
@@ -629,62 +567,6 @@ BinderTest.prototype.testDeleteAttributeIfEvaluatesFalse = function() {
629567 assertChild ( 5 , false ) ;
630568} ;
631569
632- BinderTest . prototype . XtestItShouldCallListenersWhenAnchorChanges = function ( ) {
633- var log = "" ;
634- var c = this . compile ( '<div ng-watch="$anchor.counter:count = count+1">' ) ;
635- c . scope . $set ( "count" , 0 ) ;
636- c . scope . $watch ( "$anchor.counter" , function ( newValue , oldValue ) {
637- log += oldValue + "->" + newValue + ";" ;
638- } ) ;
639- assertEquals ( 0 , c . scope . $get ( "count" ) ) ;
640- c . binder . location . url = "#counter=1" ;
641- c . binder . onUrlChange ( ) ;
642- assertEquals ( 1 , c . scope . $get ( "count" ) ) ;
643-
644- c . binder . location . url = "#counter=1" ;
645- c . binder . onUrlChange ( ) ;
646- assertEquals ( 1 , c . scope . $get ( "count" ) ) ;
647-
648- c . binder . location . url = "#counter=2" ;
649- c . binder . onUrlChange ( ) ;
650- assertEquals ( 2 , c . scope . $get ( "count" ) ) ;
651-
652- c . binder . location . url = "#counter=2" ;
653- c . binder . onUrlChange ( ) ;
654- assertEquals ( 2 , c . scope . $get ( "count" ) ) ;
655-
656- c . binder . location . url = "#" ;
657- c . binder . onUrlChange ( ) ;
658- assertEquals ( "undefined->1;1->2;2->undefined;" , log ) ;
659- assertEquals ( 3 , c . scope . $get ( "count" ) ) ;
660- } ;
661-
662- BinderTest . prototype . XtestParseQueryString = function ( ) {
663- var binder = new Binder ( ) ;
664- assertJsonEquals ( { "a" :"1" } , binder . parseQueryString ( "a=1" ) ) ;
665- assertJsonEquals ( { "a" :"1" , "b" :"two" } , binder . parseQueryString ( "a=1&b=two" ) ) ;
666- assertJsonEquals ( { } , binder . parseQueryString ( "" ) ) ;
667-
668- assertJsonEquals ( { "a" :"1" , "b" :"" } , binder . parseQueryString ( "a=1&b=" ) ) ;
669- assertJsonEquals ( { "a" :"1" , "b" :"" } , binder . parseQueryString ( "a=1&b" ) ) ;
670- assertJsonEquals ( { "a" :"1" , "b" :" 2 " } , binder . parseQueryString ( "a=1&b=%202%20" ) ) ;
671- assertJsonEquals ( { "a a" :"1" , "b" :"2" } , binder . parseQueryString ( "a%20a=1&b=2" ) ) ;
672-
673- } ;
674-
675- BinderTest . prototype . XtestSetBinderAnchorTriggersListeners = function ( ) {
676- expectAsserts ( 2 ) ;
677- var doc = this . compile ( "<div/>" ) ;
678-
679- doc . scope . $watch ( "$anchor.name" , function ( newVal , oldVal ) {
680- assertEquals ( "new" , newVal ) ;
681- assertEquals ( undefined , oldVal ) ;
682- } ) ;
683-
684- doc . $anchor . name = "new" ;
685- doc . binder . onUrlChange ( "http://base#name=new" ) ;
686- } ;
687-
688570BinderTest . prototype . testItShouldDisplayErrorWhenActionIsSyntacticlyIncorect = function ( ) {
689571 var c = this . compile ( '<div>' +
690572 '<input type="button" ng-click="greeting=\'ABC\'"/>' +
@@ -768,9 +650,9 @@ BinderTest.prototype.testItBindHiddenInputFields = function(){
768650 assertEquals ( "abc" , x . scope . $get ( "myName" ) ) ;
769651} ;
770652
771- BinderTest . prototype . xtestItShouldRenderMultiRootHtmlInBinding = function ( ) {
653+ BinderTest . prototype . XtestItShouldRenderMultiRootHtmlInBinding = function ( ) {
772654 var x = this . compile ( '<div>before {{a|html}}after</div>' ) ;
773- x . scope . $set ( "a" , "a<b>c</b>d" ) ;
655+ x . scope . a = "a<b>c</b>d" ;
774656 x . scope . $eval ( ) ;
775657 assertEquals (
776658 '<div>before <span ng-bind="a|html">a<b>c</b>d</span>after</div>' ,
@@ -790,20 +672,3 @@ BinderTest.prototype.testItShouldUseFormaterForText = function() {
790672 assertEquals ( '1, 2, 3' , input [ 0 ] . value ) ;
791673} ;
792674
793- BinderTest . prototype . XtestWriteAnchor = function ( ) {
794- var binder = this . compile ( "<div/>" ) . binder ;
795- binder . location . set ( 'a' ) ;
796- binder . anchor . a = 'b' ;
797- binder . anchor . c = ' ' ;
798- binder . anchor . d = true ;
799- binder . updateAnchor ( ) ;
800- assertEquals ( binder . location . get ( ) , "a#a=b&c=%20&d" ) ;
801- } ;
802-
803- BinderTest . prototype . XtestWriteAnchorAsPartOfTheUpdateView = function ( ) {
804- var binder = this . compile ( "<div/>" ) . binder ;
805- binder . location . set ( 'a' ) ;
806- binder . anchor . a = 'b' ;
807- binder . updateView ( ) ;
808- assertEquals ( binder . location . get ( ) , "a#a=b" ) ;
809- } ;
0 commit comments