mirror of
https://github.com/chartjs/Chart.js.git
synced 2025-12-08 20:36:08 +00:00
Automatically expose custom Jasmine matchers
This commit is contained in:
parent
8254331eef
commit
4901471445
@ -1,10 +1,5 @@
|
||||
// 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',
|
||||
|
||||
@ -1,10 +1,5 @@
|
||||
// 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',
|
||||
|
||||
@ -1,10 +1,5 @@
|
||||
// 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',
|
||||
|
||||
@ -1,10 +1,5 @@
|
||||
// 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',
|
||||
|
||||
@ -1,10 +1,5 @@
|
||||
// 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',
|
||||
|
||||
@ -1,9 +1,5 @@
|
||||
// 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',
|
||||
|
||||
@ -1,9 +1,5 @@
|
||||
// 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',
|
||||
|
||||
@ -1,10 +1,5 @@
|
||||
// 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);
|
||||
|
||||
@ -1,10 +1,5 @@
|
||||
// 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',
|
||||
|
||||
@ -158,12 +158,12 @@
|
||||
};
|
||||
}
|
||||
|
||||
window.addDefaultMatchers = function(jasmine) {
|
||||
beforeEach(function() {
|
||||
jasmine.addMatchers({
|
||||
toBeCloseToPixel: toBeCloseToPixel,
|
||||
toEqualOneOf: toEqualOneOf
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Canvas injection helpers
|
||||
var charts = {};
|
||||
|
||||
@ -1,8 +1,4 @@
|
||||
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);
|
||||
|
||||
@ -1,9 +1,4 @@
|
||||
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);
|
||||
|
||||
@ -1,9 +1,5 @@
|
||||
// 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);
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
// Time scale tests
|
||||
describe('Time scale tests', function() {
|
||||
beforeEach(function() {
|
||||
window.addDefaultMatchers(jasmine);
|
||||
|
||||
// Need a time matcher for getValueFromPixel
|
||||
jasmine.addMatchers({
|
||||
toBeCloseToTime: function() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user