Skip to content

Commit 55b6ec0

Browse files
authored
Fix the variable based tests to search for the appropriate values (#12197)
* Columns were changed but tests weren't * Review feedback
1 parent cf8504f commit 55b6ec0

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/test/datascience/variableTestHelpers.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,26 +67,32 @@ export function verifyVariables(
6767
});
6868
}
6969

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+
7076
// Verify a single row versus a single expected variable
7177
function verifyRow(rowWrapper: ReactWrapper<any, Readonly<{}>, React.Component>, targetVariable: IJupyterVariable) {
7278
const rowCells = rowWrapper.find('div.react-grid-Cell');
7379

7480
expect(rowCells.length).to.be.equal(5, 'Unexpected number of cells in variable explorer row');
7581

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);
7884

7985
if (targetVariable.shape && targetVariable.shape !== '') {
80-
verifyCell(rowCells.at(2), targetVariable.shape, targetVariable.name);
86+
verifyCell(rowCells.at(Shape_Column), targetVariable.shape, targetVariable.name);
8187
} 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);
8389
}
8490

8591
if (targetVariable.value) {
86-
verifyCell(rowCells.at(3), targetVariable.value, targetVariable.name);
92+
verifyCell(rowCells.at(Value_Column), targetVariable.value, targetVariable.name);
8793
}
8894

89-
verifyCell(rowCells.at(4), targetVariable.supportsDataExplorer, targetVariable.name);
95+
verifyCell(rowCells.at(Button_Column), targetVariable.supportsDataExplorer, targetVariable.name);
9096
}
9197

9298
// Verify a single cell value against a specific target value

0 commit comments

Comments
 (0)