@@ -1649,85 +1649,6 @@ describe('directive',function(){
16491649 } ) ;
16501650
16511651
1652- it ( 'should show the correct option selected' , function ( ) {
1653- inject ( function ( $compile , $rootScope ) {
1654- var scope = $rootScope . $new ( ) ;
1655- scope . thing = { id : 2 , a : 1 } ;
1656-
1657- scope . schema = {
1658- "type" : "object" ,
1659- "properties" : {
1660- "thing" : {
1661- "title" : "Thing"
1662- }
1663- }
1664- } ;
1665-
1666- scope . form = [ {
1667- key : "thing" ,
1668- type : 'select' ,
1669- titleMap : [ {
1670- name : 'abc' , value : { id : 1 , a : 2 }
1671- } , {
1672- name : 'def' , value : { id : 2 , a : 1 }
1673- } , {
1674- name : 'ghi' , value : { id : 3 , a : 3 }
1675- } ]
1676- } ] ;
1677-
1678- var tmpl = angular . element ( '<form sf-schema="schema" sf-form="form" sf-model="thing"></form>' ) ;
1679-
1680- $compile ( tmpl ) ( scope ) ;
1681- $rootScope . $apply ( ) ;
1682-
1683- setTimeout ( function ( ) {
1684- tmpl . children ( ) . eq ( 0 ) . find ( 'select' ) . eq ( 0 ) . val ( ) . should . be . eq ( 2 ) ;
1685- } , 0 ) ;
1686-
1687- } ) ;
1688- } ) ;
1689-
1690-
1691- it ( 'should show the correct option selected with `track by`' , function ( ) {
1692- inject ( function ( $compile , $rootScope ) {
1693- var scope = $rootScope . $new ( ) ;
1694- scope . thing = { id : 2 , a : 1 , b : 2 } ;
1695-
1696- scope . schema = {
1697- "type" : "object" ,
1698- "properties" : {
1699- "thing" : {
1700- "title" : "Thing"
1701- }
1702- }
1703- } ;
1704-
1705- scope . form = [ {
1706- key : "thing" ,
1707- type : 'select' ,
1708- titleMap : [ {
1709- id : 1 , name : 'abc' , value : { id : 1 }
1710- } , {
1711- id : 2 , name : 'def' , value : { id : 2 }
1712- } , {
1713- id : 3 , name : 'ghi' , value : { id : 3 }
1714- } ] ,
1715- trackBy : 'id'
1716- } ] ;
1717-
1718- var tmpl = angular . element ( '<form sf-schema="schema" sf-form="form" sf-model="thing"></form>' ) ;
1719-
1720- $compile ( tmpl ) ( scope ) ;
1721- $rootScope . $apply ( ) ;
1722-
1723- setTimeout ( function ( ) {
1724- tmpl . children ( ) . eq ( 0 ) . find ( 'select' ) . eq ( 0 ) . val ( ) . should . be . eq ( 2 ) ;
1725- } , 0 ) ;
1726-
1727- } ) ;
1728- } ) ;
1729-
1730-
17311652 it ( 'should update array form on model array ref change' , function ( ) {
17321653
17331654 inject ( function ( $compile , $rootScope ) {
0 commit comments