Skip to content

Commit

Permalink
Unit test for issue w3c#372
Browse files Browse the repository at this point in the history
  • Loading branch information
almossawi committed Feb 26, 2015
1 parent 2b642e8 commit e899bc7
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions tests/common/x_axis_test.js
Expand Up @@ -142,7 +142,7 @@ test('args.x_extended_ticks', function() {
ok(document.querySelector('.mg-extended-x-ticks'), 'X-axis extended ticks exist');
});

test('correctly calculates min and max values for line, point and histogram charts', function() {
test('Correctly calculates min and max values for line, point and histogram charts', function() {
var args;

// single series
Expand Down Expand Up @@ -186,7 +186,7 @@ test('correctly calculates min and max values for line, point and histogram char
equal(args.processed.max_x, 7, 'max is correct for multiple series');
});

test('correctly calculates min and max values for bar chart', function() {
test('Correctly calculates min and max values for bar chart', function() {
var args;

// single series
Expand All @@ -209,3 +209,16 @@ test('correctly calculates min and max values for bar chart', function() {
equal(args.processed.min_x, 0, 'min is correct');
equal(args.processed.max_x, 12, 'max is correct');
});

test('Ensure that custom xax_format isn\'t deleted', function() {
var params = {
title: 'foo',
target: '.result',
xax_format: function(d) { return 'humbug'; },
data: [{'date': new Date('2014-01-01'), 'value': 12},
{'date': new Date('2014-03-01'), 'value': 18}]
};

MG.data_graphic(params);
equal(params.xax_format(), 'humbug', 'xax_format hasn\'t been overriden');
});

0 comments on commit e899bc7

Please sign in to comment.