@@ -14,7 +14,7 @@ export function main() {
1414 } ) ;
1515
1616 it ( 'should initialize correctly' , ( done ) => {
17- var template = '<div><ig-tree-grid [(widgetId)]="gridID" [(options)]="opts" [changeDetectionInterval ]="cdi "></ig-tree-grid></div>' ;
17+ var template = '<div><ig-tree-grid [(widgetId)]="gridID" [(options)]="opts" [dataSource ]="data "></ig-tree-grid></div>' ;
1818 TestBed . overrideComponent ( TestComponent , {
1919 set : {
2020 template : template
@@ -30,7 +30,7 @@ export function main() {
3030 } ) ;
3131
3232 it ( 'should reflect changes when a record in the data changes' , ( done ) => {
33- var template = '<div><ig-tree-grid [(widgetId)]="gridID" [(options)]="opts" [changeDetectionInterval ]="cdi "></ig-tree-grid></div>' ;
33+ var template = '<div><ig-tree-grid [(widgetId)]="gridID" [(options)]="opts" [dataSource ]="data "></ig-tree-grid></div>' ;
3434 TestBed . overrideComponent ( TestComponent , {
3535 set : {
3636 template : template
@@ -39,6 +39,8 @@ export function main() {
3939 TestBed . compileComponents ( ) . then ( ( ) => {
4040 let fixture = TestBed . createComponent ( TestComponent ) ;
4141 fixture . detectChanges ( ) ;
42+ fixture . componentInstance . data [ 0 ] . tasks = "" ;
43+ fixture . detectChanges ( ) ;
4244 fixture . componentInstance . data [ 0 ] . tasks = "Test" ;
4345 fixture . detectChanges ( ) ;
4446 setTimeout ( ( ) => {
@@ -51,7 +53,7 @@ export function main() {
5153 } ) ;
5254
5355 it ( 'should reflect changes when a record is added/removed from the data' , ( done ) => {
54- var template = '<div><ig-tree-grid [(widgetId)]="gridID" [(options)]="opts" [changeDetectionInterval ]="cdi "></ig-tree-grid></div>' ;
56+ var template = '<div><ig-tree-grid [(widgetId)]="gridID" [(options)]="opts" [dataSource ]="data "></ig-tree-grid></div>' ;
5557 TestBed . overrideComponent ( TestComponent , {
5658 set : {
5759 template : template
@@ -62,6 +64,8 @@ export function main() {
6264 fixture . detectChanges ( ) ;
6365 //remove item
6466 fixture . componentInstance . data [ 0 ] . products . removeAt ( 4 ) ;
67+
68+ fixture . componentInstance . viewChild . markForCheck ( ) ;
6569
6670 setTimeout ( ( ) => {
6771 fixture . detectChanges ( ) ;
@@ -83,7 +87,7 @@ export function main() {
8387 } ) ;
8488
8589 it ( 'should reflect changes when the root record is removed' , ( done ) => {
86- var template = '<div><ig-tree-grid [(widgetId)]="gridID" [(options)]="opts" [changeDetectionInterval ]="cdi "></ig-tree-grid></div>' ;
90+ var template = '<div><ig-tree-grid [(widgetId)]="gridID" [(options)]="opts" [dataSource ]="data "></ig-tree-grid></div>' ;
8791 TestBed . overrideComponent ( TestComponent , {
8892 set : {
8993 template : template
@@ -105,7 +109,7 @@ export function main() {
105109 } ) ;
106110
107111 it ( 'should reflect changes when records in the treegrid are updated/added/deleted' , ( done ) => {
108- var template = '<div><ig-tree-grid [(widgetId)]="gridID" [(options)]="opts" [changeDetectionInterval ]="cdi "></ig-tree-grid></div>' ;
112+ var template = '<div><ig-tree-grid [(widgetId)]="gridID" [(options)]="opts" [dataSource ]="data "></ig-tree-grid></div>' ;
109113 TestBed . overrideComponent ( TestComponent , {
110114 set : {
111115 template : template
@@ -114,7 +118,6 @@ export function main() {
114118 TestBed . compileComponents ( ) . then ( ( ) => {
115119 let fixture = TestBed . createComponent ( TestComponent ) ;
116120 fixture . detectChanges ( ) ;
117-
118121 //update row
119122 $ ( "#grid1" ) . igTreeGridUpdating ( "updateRow" , 0 , { tasks : "Updated Plan" } ) ;
120123 setTimeout ( ( ) => {
@@ -163,7 +166,7 @@ export function main() {
163166
164167
165168 it ( "should detect changes when original data source is changed but the data source length is the same." , ( done ) => {
166- var template = '<ig-tree-grid [(widgetId)]="gridID" [(options)]="optsNew"></ig-tree-grid>' ;
169+ var template = '<ig-tree-grid [(widgetId)]="gridID" [(options)]="optsNew" [dataSource]="singleRecData" ></ig-tree-grid>' ;
167170 TestBed . overrideComponent ( TestComponent , {
168171 set : {
169172 template : template
@@ -207,7 +210,7 @@ class TestComponent {
207210 this . singleRecData2 = [ { "id" : 1 , "tasks" : "Test" } ] ;
208211 this . opts = {
209212 autoCommit : true ,
210- dataSource : this . data ,
213+ // dataSource: this.data,
211214 width : "100%" ,
212215 height : "400px" ,
213216 autoGenerateColumns : false ,
0 commit comments