Skip to content

Commit 74da7a4

Browse files
committed
include test that we didn't add any categories to category tickvals test
1 parent 27fb4b1 commit 74da7a4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/jasmine/tests/axes_test.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,15 +1555,16 @@ describe('Test axes', function() {
15551555
});
15561556

15571557
it('should handle tickvals edge cases with category axes', function() {
1558-
var textOut = mockCalc({
1558+
var ax = {
15591559
type: 'category',
15601560
_categories: ['a', 'b', 'c', 'd'],
15611561
tickmode: 'array',
15621562
tickvals: ['a', 1, 1.5, 'c', 2.7, 3, 'e', 4, 5, -2],
15631563
ticktext: ['A!', 'B?', 'B->C'],
15641564
range: [-0.5, 4.5],
15651565
nticks: 10
1566-
});
1566+
};
1567+
var textOut = mockCalc(ax);
15671568

15681569
var expectedText = [
15691570
'A!', // category position, explicit text
@@ -1577,6 +1578,8 @@ describe('Test axes', function() {
15771578
// 'e', 5, -2: bad category and numbers out of range: omitted
15781579
];
15791580
expect(textOut).toEqual(expectedText);
1581+
// make sure we didn't add any more axes accidentally
1582+
expect(ax._categories).toEqual(['a', 'b', 'c', 'd']);
15801583
});
15811584
});
15821585
});

0 commit comments

Comments
 (0)