]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Down to 3 test failures
authorEvert Timberg <evert.timberg@gmail.com>
Sun, 18 Oct 2015 23:48:57 +0000 (19:48 -0400)
committerEvert Timberg <evert.timberg@gmail.com>
Sun, 18 Oct 2015 23:48:57 +0000 (19:48 -0400)
test/core.helpers.tests.js
test/scale.category.tests.js
test/scale.linear.tests.js
test/scale.logarithmic.tests.js
test/scale.radialLinear.tests.js
test/scale.time.tests.js

index ce0c987579fba79aa297b8b51bdd14a782725955..0320a84aa57be2cf4e039b4f83062b92a06b409d 100644 (file)
@@ -244,7 +244,7 @@ describe('Core helper tests', function() {
                                                padding: 10,
                                                reverse: false,
                                                show: true,
-                                               template: "<%=value%>"
+                                               callback: merged.scales.yAxes[1].ticks.callback, // make it nicer, then check explicitly below
                                        },
                                        type: 'linear'
                                }, {
@@ -281,12 +281,16 @@ describe('Core helper tests', function() {
                                                padding: 10,
                                                reverse: false,
                                                show: true,
-                                               template: "<%=value%>"
+                                               callback: merged.scales.yAxes[2].ticks.callback, // make it nicer, then check explicitly below
                                        },
                                        type: 'linear'
                                }]
                        }
                });
+
+               // Are these actually functions
+               expect(merged.scales.yAxes[1].ticks.callback).toEqual(jasmine.any(Function));
+               expect(merged.scales.yAxes[2].ticks.callback).toEqual(jasmine.any(Function));
        });
 
        it('should get value or default', function() {
index d6ec96f960a21c428963b7d5a56deb859a52bf42..e5ac45a297cf0d029ed49be849ddd4a1fe1a2110 100644 (file)
@@ -43,9 +43,12 @@ describe('Category scale tests', function() {
                                padding: 10,
                                reverse: false,
                                show: true,
-                               template: "<%=value%>"
+                               callback: defaultConfig.ticks.callback,  // make this nicer, then check explicitly below
                        }
                });
+
+               // Is this actually a function
+               expect(defaultConfig.ticks.callback).toEqual(jasmine.any(Function));
        });
 
        it('Should generate ticks from the data labales', function() {
index dd31c7bce33806e59880f62342a72bff69e026c2..d0378ed243782fdb5eebd5c8d5136c3ba3c52da4 100644 (file)
@@ -42,9 +42,11 @@ describe('Linear Scale', function() {
                                padding: 10,
                                reverse: false,
                                show: true,
-                               template: "<%=value%>"
+                               callback: defaultConfig.ticks.callback, // make this work nicer, then check below
                        }
                });
+
+               expect(defaultConfig.ticks.callback).toEqual(jasmine.any(Function));
        });
 
        it('Should correctly determine the max & min data values', function() {
index ea1092749becec3dcbb093014383ba740cd8ab5c..72250df73ba0832984c0b39ce596a23dff7a3b9c 100644 (file)
@@ -41,9 +41,12 @@ describe('Logarithmic Scale tests', function() {
                                padding: 10,
                                reverse: false,
                                show: true,
-                               template: "<%var remain = value / (Math.pow(10, Math.floor(Chart.helpers.log10(value))));if (remain === 1 || remain === 2 || remain === 5) {%><%=value.toExponential()%><%} else {%><%= null %><%}%>",
+                               callback: defaultConfig.ticks.callback, // make this nicer, then check explicitly below
                        },
                });
+
+               // Is this actually a function
+               expect(defaultConfig.ticks.callback).toEqual(jasmine.any(Function));
        });
 
        it('Should correctly determine the max & min data values', function() {
index 5a762078918b2c1da7eaf57be3dee55de438466f..0b2512e9b3b401d565f3ca1ebc3cd3c389f0c881 100644 (file)
@@ -58,10 +58,13 @@ describe('Test the radial linear scale', function() {
                                reverse: false,
                                showLabelBackdrop: true,
                                show: true,
-                               template: "<%=value%>",
+                               callback: defaultConfig.ticks.callback, // make this nicer, then check explicitly below
 
                        },
                });
+
+               // Is this actually a function
+               expect(defaultConfig.ticks.callback).toEqual(jasmine.any(Function));
        });
 
        it('Should correctly determine the max & min data values', function() {
index eb573df4a273982f3db6aa57bf2b7c1d47374947..1fbd9ab8809b8afd74a28c07056aa215cb444302 100644 (file)
@@ -46,7 +46,7 @@ describe('Time scale tests', function() {
                                padding: 10,
                                reverse: false,
                                show: true,
-                               template: "<%=value%>"
+                               callback: defaultConfig.ticks.callback, // make this nicer, then check explicitly below
                        },
                        time: {
                                format: false,
@@ -55,6 +55,9 @@ describe('Time scale tests', function() {
                                displayFormat: false,
                        }
                });
+
+               // Is this actually a function
+               expect(defaultConfig.ticks.callback).toEqual(jasmine.any(Function));
        });
 
        it('should build ticks using days', function() {