@@ -144,24 +144,44 @@ describe('tree toggle', () => {
144144 expect ( toggle . level ) . to . equal ( 0 ) ;
145145 } ) ;
146146
147- it ( 'should have a higher level' , ( ) => {
148- column . itemHasChildrenPath = 'hasChildren' ;
149- toggle . expanded = true ;
150- const childToggle = getBodyCellContent ( grid , 1 , 0 ) . firstElementChild ;
151- expect ( childToggle . level ) . to . equal ( 1 ) ;
152- } ) ;
153-
154- it ( 'should not be a leaf' , ( ) => {
155- column . itemHasChildrenPath = 'hasChildren' ;
156- expect ( toggle . leaf ) . to . be . false ;
157- } ) ;
158-
159147 it ( 'should ignore a custom renderer' , ( ) => {
160148 column . renderer = ( root ) => {
161149 root . innerHTML = 'cell' ;
162150 } ;
163151
164152 expect ( getBodyCellContent ( grid , 0 , 0 ) . firstElementChild ) . to . equal ( toggle ) ;
165153 } ) ;
154+
155+ describe ( 'itemHasChildrenPath' , ( ) => {
156+ beforeEach ( ( ) => {
157+ sinon . stub ( console , 'warn' ) ;
158+ } ) ;
159+
160+ afterEach ( ( ) => {
161+ console . warn . restore ( ) ;
162+ } ) ;
163+
164+ it ( 'should have a higher level' , ( ) => {
165+ column . itemHasChildrenPath = 'hasChildren' ;
166+ toggle . expanded = true ;
167+ const childToggle = getBodyCellContent ( grid , 1 , 0 ) . firstElementChild ;
168+ expect ( childToggle . level ) . to . equal ( 1 ) ;
169+ } ) ;
170+
171+ it ( 'should not be a leaf' , ( ) => {
172+ column . itemHasChildrenPath = 'hasChildren' ;
173+ expect ( toggle . leaf ) . to . be . false ;
174+ } ) ;
175+
176+ it ( 'should warn when setting column property' , ( ) => {
177+ column . itemHasChildrenPath = 'hasChildren' ;
178+ expect ( console . warn . called ) . to . be . true ;
179+ } ) ;
180+
181+ it ( 'should forward column property to the grid' , ( ) => {
182+ column . itemHasChildrenPath = 'hasChildren' ;
183+ expect ( grid . itemHasChildrenPath ) . to . equal ( 'hasChildren' ) ;
184+ } ) ;
185+ } ) ;
166186 } ) ;
167187} ) ;
0 commit comments