// Test the bar controller
describe('Bar controller tests', function() {
-
- beforeEach(function() {
- window.addDefaultMatchers(jasmine);
- });
-
it('should be constructed', function() {
var chart = window.acquireChart({
type: 'bar',
// Test the bubble controller
describe('Bubble controller tests', function() {
-
- beforeEach(function() {
- window.addDefaultMatchers(jasmine);
- });
-
it('should be constructed', function() {
var chart = window.acquireChart({
type: 'bubble',
// Test the bar controller
describe('Doughnut controller tests', function() {
-
- beforeEach(function() {
- window.addDefaultMatchers(jasmine);
- });
-
it('should be constructed', function() {
var chart = window.acquireChart({
type: 'doughnut',
// Test the line controller
describe('Line controller tests', function() {
-
- beforeEach(function() {
- window.addDefaultMatchers(jasmine);
- });
-
it('should be constructed', function() {
var chart = window.acquireChart({
type: 'line',
// Test the polar area controller
describe('Polar area controller tests', function() {
-
- beforeEach(function() {
- window.addDefaultMatchers(jasmine);
- });
-
it('should be constructed', function() {
var chart = window.acquireChart({
type: 'polarArea',
// Test the polar area controller
describe('Radar controller tests', function() {
- beforeEach(function() {
- window.addDefaultMatchers(jasmine);
- });
-
it('Should be constructed', function() {
var chart = window.acquireChart({
type: 'radar',
// Tests of the scale service
describe('Test the layout service', function() {
- beforeEach(function() {
- window.addDefaultMatchers(jasmine);
- });
-
it('should fit a simple chart with 2 scales', function() {
var chart = window.acquireChart({
type: 'bar',
// Test the rectangle element
describe('Legend block tests', function() {
-
- beforeEach(function() {
- window.addDefaultMatchers(jasmine);
- });
-
it('Should be constructed', function() {
var legend = new Chart.Legend({});
expect(legend).not.toBe(undefined);
// Test the rectangle element
describe('tooltip tests', function() {
-
- beforeEach(function() {
- window.addDefaultMatchers(jasmine);
- });
-
it('Should display in label mode', function() {
var chartInstance = window.acquireChart({
type: 'line',
};
}
- window.addDefaultMatchers = function(jasmine) {
+ beforeEach(function() {
jasmine.addMatchers({
toBeCloseToPixel: toBeCloseToPixel,
toEqualOneOf: toEqualOneOf
});
- }
+ });
// Canvas injection helpers
var charts = {};
describe('Linear Scale', function() {
- beforeEach(function() {
- window.addDefaultMatchers(jasmine);
- });
-
it('Should register the constructor with the scale service', function() {
var Constructor = Chart.scaleService.getScaleConstructor('linear');
expect(Constructor).not.toBe(undefined);
describe('Logarithmic Scale tests', function() {
-
- beforeEach(function() {
- window.addDefaultMatchers(jasmine);
- });
-
it('should register the constructor with the scale service', function() {
var Constructor = Chart.scaleService.getScaleConstructor('logarithmic');
expect(Constructor).not.toBe(undefined);
// Tests for the radial linear scale used by the polar area and radar charts
describe('Test the radial linear scale', function() {
- beforeEach(function() {
- window.addDefaultMatchers(jasmine);
- });
-
it('Should register the constructor with the scale service', function() {
var Constructor = Chart.scaleService.getScaleConstructor('radialLinear');
expect(Constructor).not.toBe(undefined);
// Time scale tests
describe('Time scale tests', function() {
beforeEach(function() {
- window.addDefaultMatchers(jasmine);
-
// Need a time matcher for getValueFromPixel
jasmine.addMatchers({
toBeCloseToTime: function() {