@@ -9,7 +9,11 @@ import {TestRunner} from '../test_runner/test_runner.js';
99 */
1010export const DataGridTestRunner = { } ;
1111
12- DataGridTestRunner . dumpDataGrid = function ( root , descentIntoCollapsed , prefix ) {
12+ DataGridTestRunner . dumpDataGrid = function (
13+ root ,
14+ descentIntoCollapsed ,
15+ prefix ,
16+ ) {
1317 if ( ! prefix ) {
1418 prefix = '' ;
1519 }
@@ -43,16 +47,16 @@ DataGridTestRunner.validateDataGrid = function(root) {
4347 throw 'Wrong parent for child ' + child . data . id + ' of ' + root . data . id ;
4448 }
4549
46- if ( child . nextSibling !== ( ( i + 1 === children . length ? null : children [ i + 1 ] ) ) ) {
47- throw 'Wrong child.nextSibling for ' + child . data . id + ' (' + i + ' of ' + children . length + ') ' ;
50+ if ( child . nextSibling !== ( i + 1 === children . length ? null : children [ i + 1 ] ) ) {
51+ throw ( 'Wrong child.nextSibling for ' + child . data . id + ' (' + i + ' of ' + children . length + ') ' ) ;
4852 }
4953
50- if ( child . previousSibling !== ( ( i ? children [ i - 1 ] : null ) ) ) {
51- throw 'Wrong child.previousSibling for ' + child . data . id + ' (' + i + ' of ' + children . length + ') ' ;
54+ if ( child . previousSibling !== ( i ? children [ i - 1 ] : null ) ) {
55+ throw ( 'Wrong child.previousSibling for ' + child . data . id + ' (' + i + ' of ' + children . length + ') ' ) ;
5256 }
5357
5458 if ( child . parent && ! child . parent . isRoot && child . depth !== root . depth + 1 ) {
55- throw 'Wrong depth for ' + child . data . id + ' expected ' + ( root . depth + 1 ) + ' but got ' + child . depth ;
59+ throw ( 'Wrong depth for ' + child . data . id + ' expected ' + ( root . depth + 1 ) + ' but got ' + child . depth ) ;
5660 }
5761
5862 DataGridTestRunner . validateDataGrid ( child ) ;
@@ -65,11 +69,12 @@ DataGridTestRunner.validateDataGrid = function(root) {
6569 throw 'Selected node is not selectable' ;
6670 }
6771 let node = selectedNode ;
68- for ( ; node && node !== root ; node = node . parent ) {
72+ while ( node && node !== root ) {
73+ node = node . parent ;
6974 }
7075
7176 if ( ! node ) {
72- throw 'Selected node (' + selectedNode . data . id + ') is not within the DataGrid' ;
77+ throw ( 'Selected node (' + selectedNode . data . id + ') is not within the DataGrid' ) ;
7378 }
7479 }
7580} ;
0 commit comments