Skip to content

Commit

Permalink
Fixed tests to use new categoryorder, categoryarray, `categorylab…
Browse files Browse the repository at this point in the history
…els` construct
  • Loading branch information
Jon M. Mease committed Aug 20, 2018
1 parent 5e60062 commit 66c90fa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/traces/parcats/parcats.js
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,7 @@ function dragDimensionEnd(d) {

restyleData['dimensions[' + d.model.containerInd + '].categoryarray'] = [newCategoryArray];
restyleData['dimensions[' + d.model.containerInd + '].categorylabels'] = [newCategoryLabels];
restyleData['dimensions[' + d.model.containerInd + '].categoryorder'] = ['array'];
restyleData['dimensions[' + d.model.containerInd + '].categoryorder'] = 'array';
}
}

Expand Down
21 changes: 10 additions & 11 deletions test/jasmine/tests/parcats_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,22 +366,22 @@ describe('Dimension reordered parcats trace', function() {
{dimensionInd: 1, displayInd: 2, dimensionLabel: 'Two'});

checkCategoryCalc(gd, 1, 0, {
categoryLabel: 'A',
categoryLabel: 'B',
dimensionInd: 1,
categoryInd: 0,
displayInd: 1});
displayInd: 0});

checkCategoryCalc(gd, 1, 1, {
categoryLabel: 'B',
categoryLabel: 'A',
dimensionInd: 1,
categoryInd: 1,
displayInd: 2});
displayInd: 1});

checkCategoryCalc(gd, 1, 2, {
categoryLabel: 'C',
dimensionInd: 1,
categoryInd: 2,
displayInd: 0});
displayInd: 2});

// ### Dimension 2 ###
checkDimensionCalc(gd, 2,
Expand All @@ -402,9 +402,6 @@ describe('Dimension reordered parcats trace', function() {
// Define bad display indexes [0, 2, 0]
mock.data[0].dimensions[2].displayindex = 0;

// catDisplayInds for dimension 1 as [0, 2, 0]
mock.data[0].dimensions[1].catDisplayInds[0] = 0;

Plotly.newPlot(gd, mock)
.then(function() {

Expand Down Expand Up @@ -440,12 +437,12 @@ describe('Dimension reordered parcats trace', function() {
{dimensionInd: 1, displayInd: 1, dimensionLabel: 'Two'});

checkCategoryCalc(gd, 1, 0, {
categoryLabel: 'A',
categoryLabel: 'B',
categoryInd: 0,
displayInd: 0});

checkCategoryCalc(gd, 1, 1, {
categoryLabel: 'B',
categoryLabel: 'A',
categoryInd: 1,
displayInd: 1});

Expand Down Expand Up @@ -737,7 +734,9 @@ describe('Drag to reordered dimensions and categories', function() {
{'dimensions[0].displayindex': 0,
'dimensions[1].displayindex': 2,
'dimensions[2].displayindex': 1,
'dimensions[1].catDisplayInds': [[ 1, 2, 0 ]]},
'dimensions[1].categoryorder': 'array',
'dimensions[1].categoryarray': [['C', 'A', 'B' ]],
'dimensions[1].categorylabels': [['C', 'A', 'B' ]]},
[0]]);

restyleCallback.calls.reset();
Expand Down

0 comments on commit 66c90fa

Please sign in to comment.