@@ -67,26 +67,32 @@ export function verifyVariables(
67
67
} ) ;
68
68
}
69
69
70
+ const Button_Column = 0 ;
71
+ const Name_Column = Button_Column + 1 ;
72
+ const Type_Column = Name_Column + 1 ;
73
+ const Shape_Column = Type_Column + 1 ;
74
+ const Value_Column = Shape_Column + 1 ;
75
+
70
76
// Verify a single row versus a single expected variable
71
77
function verifyRow ( rowWrapper : ReactWrapper < any , Readonly < { } > , React . Component > , targetVariable : IJupyterVariable ) {
72
78
const rowCells = rowWrapper . find ( 'div.react-grid-Cell' ) ;
73
79
74
80
expect ( rowCells . length ) . to . be . equal ( 5 , 'Unexpected number of cells in variable explorer row' ) ;
75
81
76
- verifyCell ( rowCells . at ( 0 ) , targetVariable . name , targetVariable . name ) ;
77
- verifyCell ( rowCells . at ( 1 ) , targetVariable . type , targetVariable . name ) ;
82
+ verifyCell ( rowCells . at ( Name_Column ) , targetVariable . name , targetVariable . name ) ;
83
+ verifyCell ( rowCells . at ( Type_Column ) , targetVariable . type , targetVariable . name ) ;
78
84
79
85
if ( targetVariable . shape && targetVariable . shape !== '' ) {
80
- verifyCell ( rowCells . at ( 2 ) , targetVariable . shape , targetVariable . name ) ;
86
+ verifyCell ( rowCells . at ( Shape_Column ) , targetVariable . shape , targetVariable . name ) ;
81
87
} else if ( targetVariable . count ) {
82
- verifyCell ( rowCells . at ( 2 ) , targetVariable . count . toString ( ) , targetVariable . name ) ;
88
+ verifyCell ( rowCells . at ( Shape_Column ) , targetVariable . count . toString ( ) , targetVariable . name ) ;
83
89
}
84
90
85
91
if ( targetVariable . value ) {
86
- verifyCell ( rowCells . at ( 3 ) , targetVariable . value , targetVariable . name ) ;
92
+ verifyCell ( rowCells . at ( Value_Column ) , targetVariable . value , targetVariable . name ) ;
87
93
}
88
94
89
- verifyCell ( rowCells . at ( 4 ) , targetVariable . supportsDataExplorer , targetVariable . name ) ;
95
+ verifyCell ( rowCells . at ( Button_Column ) , targetVariable . supportsDataExplorer , targetVariable . name ) ;
90
96
}
91
97
92
98
// Verify a single cell value against a specific target value
0 commit comments