]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Add "point style" image tests
authorSimon Brunel <simonbrunel@users.noreply.github.com>
Mon, 9 Jul 2018 19:14:25 +0000 (21:14 +0200)
committerSimon Brunel <simonbrunel@users.noreply.github.com>
Sun, 29 Jul 2018 20:43:23 +0000 (22:43 +0200)
Replace the old style canvas "mock" context checks by image based unit tests which are easier to maintain and allow more flexibility in the drawing logic since we are not testing the context calls but the final painted result.

30 files changed:
test/fixtures/controller.bubble/point-style.json [new file with mode: 0644]
test/fixtures/controller.bubble/point-style.png [new file with mode: 0644]
test/fixtures/controller.line/point-style.json [new file with mode: 0644]
test/fixtures/controller.line/point-style.png [new file with mode: 0644]
test/fixtures/controller.radar/point-style.json [new file with mode: 0644]
test/fixtures/controller.radar/point-style.png [new file with mode: 0644]
test/fixtures/element.point/point-style-circle.json [new file with mode: 0644]
test/fixtures/element.point/point-style-circle.png [new file with mode: 0644]
test/fixtures/element.point/point-style-cross-rot.json [new file with mode: 0644]
test/fixtures/element.point/point-style-cross-rot.png [new file with mode: 0644]
test/fixtures/element.point/point-style-cross.json [new file with mode: 0644]
test/fixtures/element.point/point-style-cross.png [new file with mode: 0644]
test/fixtures/element.point/point-style-dash.json [new file with mode: 0644]
test/fixtures/element.point/point-style-dash.png [new file with mode: 0644]
test/fixtures/element.point/point-style-line.json [new file with mode: 0644]
test/fixtures/element.point/point-style-line.png [new file with mode: 0644]
test/fixtures/element.point/point-style-rect-rot.json [new file with mode: 0644]
test/fixtures/element.point/point-style-rect-rot.png [new file with mode: 0644]
test/fixtures/element.point/point-style-rect-rounded.json [new file with mode: 0644]
test/fixtures/element.point/point-style-rect-rounded.png [new file with mode: 0644]
test/fixtures/element.point/point-style-rect.json [new file with mode: 0644]
test/fixtures/element.point/point-style-rect.png [new file with mode: 0644]
test/fixtures/element.point/point-style-star.json [new file with mode: 0644]
test/fixtures/element.point/point-style-star.png [new file with mode: 0644]
test/fixtures/element.point/point-style-triangle.json [new file with mode: 0644]
test/fixtures/element.point/point-style-triangle.png [new file with mode: 0644]
test/specs/controller.bubble.tests.js
test/specs/controller.line.tests.js
test/specs/controller.radar.tests.js
test/specs/element.point.tests.js

diff --git a/test/fixtures/controller.bubble/point-style.json b/test/fixtures/controller.bubble/point-style.json
new file mode 100644 (file)
index 0000000..a645075
--- /dev/null
@@ -0,0 +1,129 @@
+{
+    "config": {
+        "type": "bubble",
+        "data": {
+            "datasets": [{
+                "data": [
+                    {"x": 0, "y": 3},
+                    {"x": 1, "y": 3},
+                    {"x": 2, "y": 3},
+                    {"x": 3, "y": 3},
+                    {"x": 4, "y": 3},
+                    {"x": 5, "y": 3},
+                    {"x": 6, "y": 3},
+                    {"x": 7, "y": 3},
+                    {"x": 8, "y": 3},
+                    {"x": 9, "y": 3}
+                ],
+                "backgroundColor": "#00ff00",
+                "borderColor": "transparent",
+                "borderWidth": 0,
+                "pointStyle": [
+                    "circle",
+                    "cross",
+                    "crossRot",
+                    "dash",
+                    "line",
+                    "rect",
+                    "rectRounded",
+                    "rectRot",
+                    "star",
+                    "triangle"
+                ]
+            }, {
+                "data": [
+                    {"x": 0, "y": 2},
+                    {"x": 1, "y": 2},
+                    {"x": 2, "y": 2},
+                    {"x": 3, "y": 2},
+                    {"x": 4, "y": 2},
+                    {"x": 5, "y": 2},
+                    {"x": 6, "y": 2},
+                    {"x": 7, "y": 2},
+                    {"x": 8, "y": 2},
+                    {"x": 9, "y": 2}
+                ],
+                "backgroundColor": "transparent",
+                "borderColor": "0000ff",
+                "borderWidth": 0,
+                "pointStyle": [
+                    "circle",
+                    "cross",
+                    "crossRot",
+                    "dash",
+                    "line",
+                    "rect",
+                    "rectRounded",
+                    "rectRot",
+                    "star",
+                    "triangle"
+                ]
+            }, {
+                "data": [
+                    {"x": 0, "y": 1},
+                    {"x": 1, "y": 1},
+                    {"x": 2, "y": 1},
+                    {"x": 3, "y": 1},
+                    {"x": 4, "y": 1},
+                    {"x": 5, "y": 1},
+                    {"x": 6, "y": 1},
+                    {"x": 7, "y": 1},
+                    {"x": 8, "y": 1},
+                    {"x": 9, "y": 1}
+                ],
+                "backgroundColor": "#00ff00",
+                "borderColor": "#0000ff",
+                "borderWidth": 0,
+                "pointStyle": [
+                    "circle",
+                    "cross",
+                    "crossRot",
+                    "dash",
+                    "line",
+                    "rect",
+                    "rectRounded",
+                    "rectRot",
+                    "star",
+                    "triangle"
+                ]
+            }]
+        },
+        "options": {
+            "responsive": false,
+            "legend": false,
+            "title": false,
+            "scales": {
+                "xAxes": [{"display": false}],
+                "yAxes": [{
+                    "display": false,
+                    "ticks": {
+                        "min": 0,
+                        "max": 4
+                    }
+                }]
+            },
+            "elements": {
+                "line": {
+                    "borderColor": "transparent",
+                    "borderWidth": 0,
+                    "fill": false
+                },
+                "point": {
+                    "radius": 16
+                }
+            },
+            "layout": {
+                "padding": {
+                    "left": 24,
+                    "right": 24
+                }
+            }
+        }
+    },
+    "options": {
+        "canvas": {
+            "height": 256,
+            "width": 512
+        }
+    }
+}
diff --git a/test/fixtures/controller.bubble/point-style.png b/test/fixtures/controller.bubble/point-style.png
new file mode 100644 (file)
index 0000000..f1d3b81
Binary files /dev/null and b/test/fixtures/controller.bubble/point-style.png differ
diff --git a/test/fixtures/controller.line/point-style.json b/test/fixtures/controller.line/point-style.json
new file mode 100644 (file)
index 0000000..ef295ad
--- /dev/null
@@ -0,0 +1,98 @@
+{
+    "config": {
+        "type": "line",
+        "data": {
+            "labels": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
+            "datasets": [{
+                "borderColor": "transparent",
+                "data": [3, 3, 3, 3, 3, 3, 3, 3, 3, 3],
+                "pointBackgroundColor": "#00ff00",
+                "pointBorderColor": "transparent",
+                "pointBorderWidth": 0,
+                "pointStyle": [
+                    "circle",
+                    "cross",
+                    "crossRot",
+                    "dash",
+                    "line",
+                    "rect",
+                    "rectRounded",
+                    "rectRot",
+                    "star",
+                    "triangle"
+                ]
+            }, {
+                "borderColor": "transparent",
+                "data": [2, 2, 2, 2, 2, 2, 2, 2, 2, 2],
+                "pointBackgroundColor": "transparent",
+                "pointBorderColor": "#0000ff",
+                "pointBorderWidth": 1,
+                "pointStyle": [
+                    "circle",
+                    "cross",
+                    "crossRot",
+                    "dash",
+                    "line",
+                    "rect",
+                    "rectRounded",
+                    "rectRot",
+                    "star",
+                    "triangle"
+                ]
+            }, {
+                "borderColor": "transparent",
+                "data": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+                "pointBackgroundColor": "#00ff00",
+                "pointBorderColor": "#0000ff",
+                "pointBorderWidth": 1,
+                "pointStyle": [
+                    "circle",
+                    "cross",
+                    "crossRot",
+                    "dash",
+                    "line",
+                    "rect",
+                    "rectRounded",
+                    "rectRot",
+                    "star",
+                    "triangle"
+                ]
+            }]
+        },
+        "options": {
+            "responsive": false,
+            "legend": false,
+            "title": false,
+            "scales": {
+                "xAxes": [{"display": false}],
+                "yAxes": [{
+                    "display": false,
+                    "ticks": {
+                        "min": 0,
+                        "max": 4
+                    }
+                }]
+            },
+            "elements": {
+                "line": {
+                    "fill": false
+                },
+                "point": {
+                    "radius": 16
+                }
+            },
+            "layout": {
+                "padding": {
+                    "left": 24,
+                    "right": 24
+                }
+            }
+        }
+    },
+    "options": {
+        "canvas": {
+            "height": 256,
+            "width": 512
+        }
+    }
+}
diff --git a/test/fixtures/controller.line/point-style.png b/test/fixtures/controller.line/point-style.png
new file mode 100644 (file)
index 0000000..f177fbf
Binary files /dev/null and b/test/fixtures/controller.line/point-style.png differ
diff --git a/test/fixtures/controller.radar/point-style.json b/test/fixtures/controller.radar/point-style.json
new file mode 100644 (file)
index 0000000..913c1cb
--- /dev/null
@@ -0,0 +1,95 @@
+{
+    "config": {
+        "type": "radar",
+        "data": {
+            "labels": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
+            "datasets": [{
+                "borderColor": "transparent",
+                "data": [3, 3, 3, 3, 3, 3, 3, 3, 3, 3],
+                "pointBackgroundColor": "#00ff00",
+                "pointBorderColor": "transparent",
+                "pointBorderWidth": 0,
+                "pointRadius": 16,
+                "pointStyle": [
+                    "circle",
+                    "cross",
+                    "crossRot",
+                    "dash",
+                    "line",
+                    "rect",
+                    "rectRounded",
+                    "rectRot",
+                    "star",
+                    "triangle"
+                ]
+            }, {
+                "borderColor": "transparent",
+                "data": [2, 2, 2, 2, 2, 2, 2, 2, 2, 2],
+                "pointBackgroundColor": "transparent",
+                "pointBorderColor": "#0000ff",
+                "pointBorderWidth": 1,
+                "pointRadius": 16,
+                "pointStyle": [
+                    "circle",
+                    "cross",
+                    "crossRot",
+                    "dash",
+                    "line",
+                    "rect",
+                    "rectRounded",
+                    "rectRot",
+                    "star",
+                    "triangle"
+                ]
+            }, {
+                "borderColor": "transparent",
+                "data": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+                "pointBackgroundColor": "#00ff00",
+                "pointBorderColor": "#0000ff",
+                "pointBorderWidth": 1,
+                "pointRadius": 16,
+                "pointStyle": [
+                    "circle",
+                    "cross",
+                    "crossRot",
+                    "dash",
+                    "line",
+                    "rect",
+                    "rectRounded",
+                    "rectRot",
+                    "star",
+                    "triangle"
+                ]
+            }]
+        },
+        "options": {
+            "responsive": false,
+            "legend": false,
+            "title": false,
+            "scale": {
+                "display": false,
+                "ticks": {
+                    "min": 0,
+                    "max": 3
+                }
+            },
+            "elements": {
+                "line": {
+                    "fill": false
+                }
+            },
+            "layout": {
+                "padding": {
+                    "left": 24,
+                    "right": 24
+                }
+            }
+        }
+    },
+    "options": {
+        "canvas": {
+            "height": 512,
+            "width": 512
+        }
+    }
+}
diff --git a/test/fixtures/controller.radar/point-style.png b/test/fixtures/controller.radar/point-style.png
new file mode 100644 (file)
index 0000000..562cb62
Binary files /dev/null and b/test/fixtures/controller.radar/point-style.png differ
diff --git a/test/fixtures/element.point/point-style-circle.json b/test/fixtures/element.point/point-style-circle.json
new file mode 100644 (file)
index 0000000..714d421
--- /dev/null
@@ -0,0 +1,67 @@
+{
+    "config": {
+        "type": "bubble",
+        "data": {
+            "datasets": [{
+                "data": [
+                    {"x": 0, "y": 3, "r": 0},
+                    {"x": 1, "y": 3, "r": 2},
+                    {"x": 2, "y": 3, "r": 4},
+                    {"x": 3, "y": 3, "r": 8},
+                    {"x": 4, "y": 3, "r": 16},
+                    {"x": 5, "y": 3, "r": 32}
+                ],
+                "backgroundColor": "#00ff00",
+                "borderColor": "transparent",
+                "borderWidth": 0
+            }, {
+                "data": [
+                    {"x": 0, "y": 2, "r": 0},
+                    {"x": 1, "y": 2, "r": 2},
+                    {"x": 2, "y": 2, "r": 4},
+                    {"x": 3, "y": 2, "r": 8},
+                    {"x": 4, "y": 2, "r": 16},
+                    {"x": 5, "y": 2, "r": 32}
+                ],
+                "backgroundColor": "transparent",
+                "borderColor": "#0000ff",
+                "borderWidth": 1
+            }, {
+                "data": [
+                    {"x": 0, "y": 1, "r": 0},
+                    {"x": 1, "y": 1, "r": 2},
+                    {"x": 2, "y": 1, "r": 4},
+                    {"x": 3, "y": 1, "r": 8},
+                    {"x": 4, "y": 1, "r": 16},
+                    {"x": 5, "y": 1, "r": 32}
+                ],
+                "backgroundColor": "#00ff00",
+                "borderColor": "#0000ff",
+                "borderWidth": 2
+            }]
+        },
+        "options": {
+            "responsive": false,
+            "legend": false,
+            "title": false,
+            "elements": {
+                "point": {
+                    "pointStyle": "circle"
+                }
+            },
+            "layout": {
+                "padding": 40
+            },
+            "scales": {
+                "xAxes": [{"display": false}],
+                "yAxes": [{"display": false}]
+            }
+        }
+    },
+    "options": {
+        "canvas": {
+            "height": 256,
+            "width": 512
+        }
+    }
+}
diff --git a/test/fixtures/element.point/point-style-circle.png b/test/fixtures/element.point/point-style-circle.png
new file mode 100644 (file)
index 0000000..d7b9bf5
Binary files /dev/null and b/test/fixtures/element.point/point-style-circle.png differ
diff --git a/test/fixtures/element.point/point-style-cross-rot.json b/test/fixtures/element.point/point-style-cross-rot.json
new file mode 100644 (file)
index 0000000..e81b8b7
--- /dev/null
@@ -0,0 +1,67 @@
+{
+    "config": {
+        "type": "bubble",
+        "data": {
+            "datasets": [{
+                "data": [
+                    {"x": 0, "y": 3, "r": 0},
+                    {"x": 1, "y": 3, "r": 2},
+                    {"x": 2, "y": 3, "r": 4},
+                    {"x": 3, "y": 3, "r": 8},
+                    {"x": 4, "y": 3, "r": 16},
+                    {"x": 5, "y": 3, "r": 32}
+                ],
+                "backgroundColor": "#00ff00",
+                "borderColor": "transparent",
+                "borderWidth": 0
+            }, {
+                "data": [
+                    {"x": 0, "y": 2, "r": 0},
+                    {"x": 1, "y": 2, "r": 2},
+                    {"x": 2, "y": 2, "r": 4},
+                    {"x": 3, "y": 2, "r": 8},
+                    {"x": 4, "y": 2, "r": 16},
+                    {"x": 5, "y": 2, "r": 32}
+                ],
+                "backgroundColor": "transparent",
+                "borderColor": "#0000ff",
+                "borderWidth": 1
+            }, {
+                "data": [
+                    {"x": 0, "y": 1, "r": 0},
+                    {"x": 1, "y": 1, "r": 2},
+                    {"x": 2, "y": 1, "r": 4},
+                    {"x": 3, "y": 1, "r": 8},
+                    {"x": 4, "y": 1, "r": 16},
+                    {"x": 5, "y": 1, "r": 32}
+                ],
+                "backgroundColor": "#00ff00",
+                "borderColor": "#0000ff",
+                "borderWidth": 2
+            }]
+        },
+        "options": {
+            "responsive": false,
+            "legend": false,
+            "title": false,
+            "elements": {
+                "point": {
+                    "pointStyle": "crossRot"
+                }
+            },
+            "layout": {
+                "padding": 40
+            },
+            "scales": {
+                "xAxes": [{"display": false}],
+                "yAxes": [{"display": false}]
+            }
+        }
+    },
+    "options": {
+        "canvas": {
+            "height": 256,
+            "width": 512
+        }
+    }
+}
diff --git a/test/fixtures/element.point/point-style-cross-rot.png b/test/fixtures/element.point/point-style-cross-rot.png
new file mode 100644 (file)
index 0000000..3f6d1df
Binary files /dev/null and b/test/fixtures/element.point/point-style-cross-rot.png differ
diff --git a/test/fixtures/element.point/point-style-cross.json b/test/fixtures/element.point/point-style-cross.json
new file mode 100644 (file)
index 0000000..5eb9944
--- /dev/null
@@ -0,0 +1,67 @@
+{
+    "config": {
+        "type": "bubble",
+        "data": {
+            "datasets": [{
+                "data": [
+                    {"x": 0, "y": 3, "r": 0},
+                    {"x": 1, "y": 3, "r": 2},
+                    {"x": 2, "y": 3, "r": 4},
+                    {"x": 3, "y": 3, "r": 8},
+                    {"x": 4, "y": 3, "r": 16},
+                    {"x": 5, "y": 3, "r": 32}
+                ],
+                "backgroundColor": "#00ff00",
+                "borderColor": "transparent",
+                "borderWidth": 0
+            }, {
+                "data": [
+                    {"x": 0, "y": 2, "r": 0},
+                    {"x": 1, "y": 2, "r": 2},
+                    {"x": 2, "y": 2, "r": 4},
+                    {"x": 3, "y": 2, "r": 8},
+                    {"x": 4, "y": 2, "r": 16},
+                    {"x": 5, "y": 2, "r": 32}
+                ],
+                "backgroundColor": "transparent",
+                "borderColor": "#0000ff",
+                "borderWidth": 1
+            }, {
+                "data": [
+                    {"x": 0, "y": 1, "r": 0},
+                    {"x": 1, "y": 1, "r": 2},
+                    {"x": 2, "y": 1, "r": 4},
+                    {"x": 3, "y": 1, "r": 8},
+                    {"x": 4, "y": 1, "r": 16},
+                    {"x": 5, "y": 1, "r": 32}
+                ],
+                "backgroundColor": "#00ff00",
+                "borderColor": "#0000ff",
+                "borderWidth": 2
+            }]
+        },
+        "options": {
+            "responsive": false,
+            "legend": false,
+            "title": false,
+            "elements": {
+                "point": {
+                    "pointStyle": "cross"
+                }
+            },
+            "layout": {
+                "padding": 40
+            },
+            "scales": {
+                "xAxes": [{"display": false}],
+                "yAxes": [{"display": false}]
+            }
+        }
+    },
+    "options": {
+        "canvas": {
+            "height": 256,
+            "width": 512
+        }
+    }
+}
diff --git a/test/fixtures/element.point/point-style-cross.png b/test/fixtures/element.point/point-style-cross.png
new file mode 100644 (file)
index 0000000..ecf3cda
Binary files /dev/null and b/test/fixtures/element.point/point-style-cross.png differ
diff --git a/test/fixtures/element.point/point-style-dash.json b/test/fixtures/element.point/point-style-dash.json
new file mode 100644 (file)
index 0000000..16f059e
--- /dev/null
@@ -0,0 +1,67 @@
+{
+    "config": {
+        "type": "bubble",
+        "data": {
+            "datasets": [{
+                "data": [
+                    {"x": 0, "y": 3, "r": 0},
+                    {"x": 1, "y": 3, "r": 2},
+                    {"x": 2, "y": 3, "r": 4},
+                    {"x": 3, "y": 3, "r": 8},
+                    {"x": 4, "y": 3, "r": 16},
+                    {"x": 5, "y": 3, "r": 32}
+                ],
+                "backgroundColor": "#00ff00",
+                "borderColor": "transparent",
+                "borderWidth": 0
+            }, {
+                "data": [
+                    {"x": 0, "y": 2, "r": 0},
+                    {"x": 1, "y": 2, "r": 2},
+                    {"x": 2, "y": 2, "r": 4},
+                    {"x": 3, "y": 2, "r": 8},
+                    {"x": 4, "y": 2, "r": 16},
+                    {"x": 5, "y": 2, "r": 32}
+                ],
+                "backgroundColor": "transparent",
+                "borderColor": "#0000ff",
+                "borderWidth": 1
+            }, {
+                "data": [
+                    {"x": 0, "y": 1, "r": 0},
+                    {"x": 1, "y": 1, "r": 2},
+                    {"x": 2, "y": 1, "r": 4},
+                    {"x": 3, "y": 1, "r": 8},
+                    {"x": 4, "y": 1, "r": 16},
+                    {"x": 5, "y": 1, "r": 32}
+                ],
+                "backgroundColor": "#00ff00",
+                "borderColor": "#0000ff",
+                "borderWidth": 2
+            }]
+        },
+        "options": {
+            "responsive": false,
+            "legend": false,
+            "title": false,
+            "elements": {
+                "point": {
+                    "pointStyle": "dash"
+                }
+            },
+            "layout": {
+                "padding": 40
+            },
+            "scales": {
+                "xAxes": [{"display": false}],
+                "yAxes": [{"display": false}]
+            }
+        }
+    },
+    "options": {
+        "canvas": {
+            "height": 256,
+            "width": 512
+        }
+    }
+}
diff --git a/test/fixtures/element.point/point-style-dash.png b/test/fixtures/element.point/point-style-dash.png
new file mode 100644 (file)
index 0000000..9c381d8
Binary files /dev/null and b/test/fixtures/element.point/point-style-dash.png differ
diff --git a/test/fixtures/element.point/point-style-line.json b/test/fixtures/element.point/point-style-line.json
new file mode 100644 (file)
index 0000000..eda6d98
--- /dev/null
@@ -0,0 +1,67 @@
+{
+    "config": {
+        "type": "bubble",
+        "data": {
+            "datasets": [{
+                "data": [
+                    {"x": 0, "y": 3, "r": 0},
+                    {"x": 1, "y": 3, "r": 2},
+                    {"x": 2, "y": 3, "r": 4},
+                    {"x": 3, "y": 3, "r": 8},
+                    {"x": 4, "y": 3, "r": 16},
+                    {"x": 5, "y": 3, "r": 32}
+                ],
+                "backgroundColor": "#00ff00",
+                "borderColor": "transparent",
+                "borderWidth": 0
+            }, {
+                "data": [
+                    {"x": 0, "y": 2, "r": 0},
+                    {"x": 1, "y": 2, "r": 2},
+                    {"x": 2, "y": 2, "r": 4},
+                    {"x": 3, "y": 2, "r": 8},
+                    {"x": 4, "y": 2, "r": 16},
+                    {"x": 5, "y": 2, "r": 32}
+                ],
+                "backgroundColor": "transparent",
+                "borderColor": "#0000ff",
+                "borderWidth": 1
+            }, {
+                "data": [
+                    {"x": 0, "y": 1, "r": 0},
+                    {"x": 1, "y": 1, "r": 2},
+                    {"x": 2, "y": 1, "r": 4},
+                    {"x": 3, "y": 1, "r": 8},
+                    {"x": 4, "y": 1, "r": 16},
+                    {"x": 5, "y": 1, "r": 32}
+                ],
+                "backgroundColor": "#00ff00",
+                "borderColor": "#0000ff",
+                "borderWidth": 2
+            }]
+        },
+        "options": {
+            "responsive": false,
+            "legend": false,
+            "title": false,
+            "elements": {
+                "point": {
+                    "pointStyle": "line"
+                }
+            },
+            "layout": {
+                "padding": 40
+            },
+            "scales": {
+                "xAxes": [{"display": false}],
+                "yAxes": [{"display": false}]
+            }
+        }
+    },
+    "options": {
+        "canvas": {
+            "height": 256,
+            "width": 512
+        }
+    }
+}
diff --git a/test/fixtures/element.point/point-style-line.png b/test/fixtures/element.point/point-style-line.png
new file mode 100644 (file)
index 0000000..2911fea
Binary files /dev/null and b/test/fixtures/element.point/point-style-line.png differ
diff --git a/test/fixtures/element.point/point-style-rect-rot.json b/test/fixtures/element.point/point-style-rect-rot.json
new file mode 100644 (file)
index 0000000..8587565
--- /dev/null
@@ -0,0 +1,67 @@
+{
+    "config": {
+        "type": "bubble",
+        "data": {
+            "datasets": [{
+                "data": [
+                    {"x": 0, "y": 3, "r": 0},
+                    {"x": 1, "y": 3, "r": 2},
+                    {"x": 2, "y": 3, "r": 4},
+                    {"x": 3, "y": 3, "r": 8},
+                    {"x": 4, "y": 3, "r": 16},
+                    {"x": 5, "y": 3, "r": 32}
+                ],
+                "backgroundColor": "#00ff00",
+                "borderColor": "transparent",
+                "borderWidth": 0
+            }, {
+                "data": [
+                    {"x": 0, "y": 2, "r": 0},
+                    {"x": 1, "y": 2, "r": 2},
+                    {"x": 2, "y": 2, "r": 4},
+                    {"x": 3, "y": 2, "r": 8},
+                    {"x": 4, "y": 2, "r": 16},
+                    {"x": 5, "y": 2, "r": 32}
+                ],
+                "backgroundColor": "transparent",
+                "borderColor": "#0000ff",
+                "borderWidth": 1
+            }, {
+                "data": [
+                    {"x": 0, "y": 1, "r": 0},
+                    {"x": 1, "y": 1, "r": 2},
+                    {"x": 2, "y": 1, "r": 4},
+                    {"x": 3, "y": 1, "r": 8},
+                    {"x": 4, "y": 1, "r": 16},
+                    {"x": 5, "y": 1, "r": 32}
+                ],
+                "backgroundColor": "#00ff00",
+                "borderColor": "#0000ff",
+                "borderWidth": 2
+            }]
+        },
+        "options": {
+            "responsive": false,
+            "legend": false,
+            "title": false,
+            "elements": {
+                "point": {
+                    "pointStyle": "rectRot"
+                }
+            },
+            "layout": {
+                "padding": 40
+            },
+            "scales": {
+                "xAxes": [{"display": false}],
+                "yAxes": [{"display": false}]
+            }
+        }
+    },
+    "options": {
+        "canvas": {
+            "height": 256,
+            "width": 512
+        }
+    }
+}
diff --git a/test/fixtures/element.point/point-style-rect-rot.png b/test/fixtures/element.point/point-style-rect-rot.png
new file mode 100644 (file)
index 0000000..09c0ada
Binary files /dev/null and b/test/fixtures/element.point/point-style-rect-rot.png differ
diff --git a/test/fixtures/element.point/point-style-rect-rounded.json b/test/fixtures/element.point/point-style-rect-rounded.json
new file mode 100644 (file)
index 0000000..6d65b46
--- /dev/null
@@ -0,0 +1,67 @@
+{
+    "config": {
+        "type": "bubble",
+        "data": {
+            "datasets": [{
+                "data": [
+                    {"x": 0, "y": 3, "r": 0},
+                    {"x": 1, "y": 3, "r": 2},
+                    {"x": 2, "y": 3, "r": 4},
+                    {"x": 3, "y": 3, "r": 8},
+                    {"x": 4, "y": 3, "r": 16},
+                    {"x": 5, "y": 3, "r": 32}
+                ],
+                "backgroundColor": "#00ff00",
+                "borderColor": "transparent",
+                "borderWidth": 0
+            }, {
+                "data": [
+                    {"x": 0, "y": 2, "r": 0},
+                    {"x": 1, "y": 2, "r": 2},
+                    {"x": 2, "y": 2, "r": 4},
+                    {"x": 3, "y": 2, "r": 8},
+                    {"x": 4, "y": 2, "r": 16},
+                    {"x": 5, "y": 2, "r": 32}
+                ],
+                "backgroundColor": "transparent",
+                "borderColor": "#0000ff",
+                "borderWidth": 1
+            }, {
+                "data": [
+                    {"x": 0, "y": 1, "r": 0},
+                    {"x": 1, "y": 1, "r": 2},
+                    {"x": 2, "y": 1, "r": 4},
+                    {"x": 3, "y": 1, "r": 8},
+                    {"x": 4, "y": 1, "r": 16},
+                    {"x": 5, "y": 1, "r": 32}
+                ],
+                "backgroundColor": "#00ff00",
+                "borderColor": "#0000ff",
+                "borderWidth": 2
+            }]
+        },
+        "options": {
+            "responsive": false,
+            "legend": false,
+            "title": false,
+            "elements": {
+                "point": {
+                    "pointStyle": "rectRounded"
+                }
+            },
+            "layout": {
+                "padding": 40
+            },
+            "scales": {
+                "xAxes": [{"display": false}],
+                "yAxes": [{"display": false}]
+            }
+        }
+    },
+    "options": {
+        "canvas": {
+            "height": 256,
+            "width": 512
+        }
+    }
+}
diff --git a/test/fixtures/element.point/point-style-rect-rounded.png b/test/fixtures/element.point/point-style-rect-rounded.png
new file mode 100644 (file)
index 0000000..a58e9e6
Binary files /dev/null and b/test/fixtures/element.point/point-style-rect-rounded.png differ
diff --git a/test/fixtures/element.point/point-style-rect.json b/test/fixtures/element.point/point-style-rect.json
new file mode 100644 (file)
index 0000000..5e2be59
--- /dev/null
@@ -0,0 +1,67 @@
+{
+    "config": {
+        "type": "bubble",
+        "data": {
+            "datasets": [{
+                "data": [
+                    {"x": 0, "y": 3, "r": 0},
+                    {"x": 1, "y": 3, "r": 2},
+                    {"x": 2, "y": 3, "r": 4},
+                    {"x": 3, "y": 3, "r": 8},
+                    {"x": 4, "y": 3, "r": 16},
+                    {"x": 5, "y": 3, "r": 32}
+                ],
+                "backgroundColor": "#00ff00",
+                "borderColor": "transparent",
+                "borderWidth": 0
+            }, {
+                "data": [
+                    {"x": 0, "y": 2, "r": 0},
+                    {"x": 1, "y": 2, "r": 2},
+                    {"x": 2, "y": 2, "r": 4},
+                    {"x": 3, "y": 2, "r": 8},
+                    {"x": 4, "y": 2, "r": 16},
+                    {"x": 5, "y": 2, "r": 32}
+                ],
+                "backgroundColor": "transparent",
+                "borderColor": "#0000ff",
+                "borderWidth": 1
+            }, {
+                "data": [
+                    {"x": 0, "y": 1, "r": 0},
+                    {"x": 1, "y": 1, "r": 2},
+                    {"x": 2, "y": 1, "r": 4},
+                    {"x": 3, "y": 1, "r": 8},
+                    {"x": 4, "y": 1, "r": 16},
+                    {"x": 5, "y": 1, "r": 32}
+                ],
+                "backgroundColor": "#00ff00",
+                "borderColor": "#0000ff",
+                "borderWidth": 2
+            }]
+        },
+        "options": {
+            "responsive": false,
+            "legend": false,
+            "title": false,
+            "elements": {
+                "point": {
+                    "pointStyle": "rect"
+                }
+            },
+            "layout": {
+                "padding": 40
+            },
+            "scales": {
+                "xAxes": [{"display": false}],
+                "yAxes": [{"display": false}]
+            }
+        }
+    },
+    "options": {
+        "canvas": {
+            "height": 256,
+            "width": 512
+        }
+    }
+}
diff --git a/test/fixtures/element.point/point-style-rect.png b/test/fixtures/element.point/point-style-rect.png
new file mode 100644 (file)
index 0000000..493c9a6
Binary files /dev/null and b/test/fixtures/element.point/point-style-rect.png differ
diff --git a/test/fixtures/element.point/point-style-star.json b/test/fixtures/element.point/point-style-star.json
new file mode 100644 (file)
index 0000000..58ea577
--- /dev/null
@@ -0,0 +1,67 @@
+{
+    "config": {
+        "type": "bubble",
+        "data": {
+            "datasets": [{
+                "data": [
+                    {"x": 0, "y": 3, "r": 0},
+                    {"x": 1, "y": 3, "r": 2},
+                    {"x": 2, "y": 3, "r": 4},
+                    {"x": 3, "y": 3, "r": 8},
+                    {"x": 4, "y": 3, "r": 16},
+                    {"x": 5, "y": 3, "r": 32}
+                ],
+                "backgroundColor": "#00ff00",
+                "borderColor": "transparent",
+                "borderWidth": 0
+            }, {
+                "data": [
+                    {"x": 0, "y": 2, "r": 0},
+                    {"x": 1, "y": 2, "r": 2},
+                    {"x": 2, "y": 2, "r": 4},
+                    {"x": 3, "y": 2, "r": 8},
+                    {"x": 4, "y": 2, "r": 16},
+                    {"x": 5, "y": 2, "r": 32}
+                ],
+                "backgroundColor": "transparent",
+                "borderColor": "#0000ff",
+                "borderWidth": 1
+            }, {
+                "data": [
+                    {"x": 0, "y": 1, "r": 0},
+                    {"x": 1, "y": 1, "r": 2},
+                    {"x": 2, "y": 1, "r": 4},
+                    {"x": 3, "y": 1, "r": 8},
+                    {"x": 4, "y": 1, "r": 16},
+                    {"x": 5, "y": 1, "r": 32}
+                ],
+                "backgroundColor": "#00ff00",
+                "borderColor": "#0000ff",
+                "borderWidth": 2
+            }]
+        },
+        "options": {
+            "responsive": false,
+            "legend": false,
+            "title": false,
+            "elements": {
+                "point": {
+                    "pointStyle": "star"
+                }
+            },
+            "layout": {
+                "padding": 40
+            },
+            "scales": {
+                "xAxes": [{"display": false}],
+                "yAxes": [{"display": false}]
+            }
+        }
+    },
+    "options": {
+        "canvas": {
+            "height": 256,
+            "width": 512
+        }
+    }
+}
diff --git a/test/fixtures/element.point/point-style-star.png b/test/fixtures/element.point/point-style-star.png
new file mode 100644 (file)
index 0000000..b5b58c0
Binary files /dev/null and b/test/fixtures/element.point/point-style-star.png differ
diff --git a/test/fixtures/element.point/point-style-triangle.json b/test/fixtures/element.point/point-style-triangle.json
new file mode 100644 (file)
index 0000000..e7657f1
--- /dev/null
@@ -0,0 +1,67 @@
+{
+    "config": {
+        "type": "bubble",
+        "data": {
+            "datasets": [{
+                "data": [
+                    {"x": 0, "y": 3, "r": 0},
+                    {"x": 1, "y": 3, "r": 2},
+                    {"x": 2, "y": 3, "r": 4},
+                    {"x": 3, "y": 3, "r": 8},
+                    {"x": 4, "y": 3, "r": 16},
+                    {"x": 5, "y": 3, "r": 32}
+                ],
+                "backgroundColor": "#00ff00",
+                "borderColor": "transparent",
+                "borderWidth": 0
+            }, {
+                "data": [
+                    {"x": 0, "y": 2, "r": 0},
+                    {"x": 1, "y": 2, "r": 2},
+                    {"x": 2, "y": 2, "r": 4},
+                    {"x": 3, "y": 2, "r": 8},
+                    {"x": 4, "y": 2, "r": 16},
+                    {"x": 5, "y": 2, "r": 32}
+                ],
+                "backgroundColor": "transparent",
+                "borderColor": "#0000ff",
+                "borderWidth": 1
+            }, {
+                "data": [
+                    {"x": 0, "y": 1, "r": 0},
+                    {"x": 1, "y": 1, "r": 2},
+                    {"x": 2, "y": 1, "r": 4},
+                    {"x": 3, "y": 1, "r": 8},
+                    {"x": 4, "y": 1, "r": 16},
+                    {"x": 5, "y": 1, "r": 32}
+                ],
+                "backgroundColor": "#00ff00",
+                "borderColor": "#0000ff",
+                "borderWidth": 2
+            }]
+        },
+        "options": {
+            "responsive": false,
+            "legend": false,
+            "title": false,
+            "elements": {
+                "point": {
+                    "pointStyle": "triangle"
+                }
+            },
+            "layout": {
+                "padding": 40
+            },
+            "scales": {
+                "xAxes": [{"display": false}],
+                "yAxes": [{"display": false}]
+            }
+        }
+    },
+    "options": {
+        "canvas": {
+            "height": 256,
+            "width": 512
+        }
+    }
+}
diff --git a/test/fixtures/element.point/point-style-triangle.png b/test/fixtures/element.point/point-style-triangle.png
new file mode 100644 (file)
index 0000000..d2cc5c6
Binary files /dev/null and b/test/fixtures/element.point/point-style-triangle.png differ
index 4799883ddfb98255e4f1b83ef505c0dd5abc725d..2597b9ae6414ba50c145d09983c29f8e7da5cb45 100644 (file)
@@ -1,4 +1,6 @@
 describe('Chart.controllers.bubble', function() {
+       describe('auto', jasmine.specsFromFixtures('controller.bubble'));
+
        it('should be constructed', function() {
                var chart = window.acquireChart({
                        type: 'bubble',
index b03162ea9d43314fb9971e0677f26def932bb8e1..ed8f4ec5c80ef50ee56b73351658870b2bbd29b0 100644 (file)
@@ -1,4 +1,6 @@
 describe('Chart.controllers.line', function() {
+       describe('auto', jasmine.specsFromFixtures('controller.line'));
+
        it('should be constructed', function() {
                var chart = window.acquireChart({
                        type: 'line',
index 8e3b8d49130631b9ce6a7912ede812f25ef77e07..2bc0a2e0d24fb0690c1c0918957291d4958d1d6d 100644 (file)
@@ -1,4 +1,6 @@
 describe('Chart.controllers.radar', function() {
+       describe('auto', jasmine.specsFromFixtures('controller.radar'));
+
        it('Should be constructed', function() {
                var chart = window.acquireChart({
                        type: 'radar',
index f1da35a50d4882b068089f8345548ec0bd1b716b..8d1227003b92d8c732e66a6581a8f4b974b35325 100644 (file)
@@ -1,6 +1,6 @@
-// Test the point element
+describe('Chart.elements.Point', function() {
+       describe('auto', jasmine.specsFromFixtures('element.point'));
 
-describe('Point element tests', function() {
        it ('Should be constructed', function() {
                var point = new Chart.elements.Point({
                        _datasetIndex: 2,
@@ -94,474 +94,6 @@ describe('Point element tests', function() {
                expect(point.getCenterPoint()).toEqual({x: 10, y: 10});
        });
 
-       it ('should draw correctly', function() {
-               var mockContext = window.createMockContext();
-               var point = new Chart.elements.Point({
-                       _datasetIndex: 2,
-                       _index: 1,
-                       _chart: {
-                               ctx: mockContext,
-                       }
-               });
-
-               // Attach a view object as if we were the controller
-               point._view = {
-                       radius: 2,
-                       pointStyle: 'circle',
-                       rotation: 25,
-                       hitRadius: 3,
-                       borderColor: 'rgba(1, 2, 3, 1)',
-                       borderWidth: 6,
-                       backgroundColor: 'rgba(0, 255, 0)',
-                       x: 10,
-                       y: 15,
-                       ctx: mockContext
-               };
-
-               point.draw();
-
-               expect(mockContext.getCalls()).toEqual([{
-                       name: 'setStrokeStyle',
-                       args: ['rgba(1, 2, 3, 1)']
-               }, {
-                       name: 'setLineWidth',
-                       args: [6]
-               }, {
-                       name: 'setFillStyle',
-                       args: ['rgba(0, 255, 0)']
-               }, {
-                       name: 'save',
-                       args: []
-               }, {
-                       name: 'translate',
-                       args: [10, 15]
-               }, {
-                       name: 'rotate',
-                       args: [25 * Math.PI / 180]
-               }, {
-                       name: 'beginPath',
-                       args: []
-               }, {
-                       name: 'arc',
-                       args: [0, 0, 2, 0, 2 * Math.PI]
-               }, {
-                       name: 'closePath',
-                       args: [],
-               }, {
-                       name: 'fill',
-                       args: [],
-               }, {
-                       name: 'stroke',
-                       args: []
-               }, {
-                       name: 'restore',
-                       args: []
-               }]);
-
-               mockContext.resetCalls();
-               point._view.pointStyle = 'triangle';
-               point.draw();
-
-               expect(mockContext.getCalls()).toEqual([{
-                       name: 'setStrokeStyle',
-                       args: ['rgba(1, 2, 3, 1)']
-               }, {
-                       name: 'setLineWidth',
-                       args: [6]
-               }, {
-                       name: 'setFillStyle',
-                       args: ['rgba(0, 255, 0)']
-               }, {
-                       name: 'save',
-                       args: []
-               }, {
-                       name: 'translate',
-                       args: [10, 15]
-               }, {
-                       name: 'rotate',
-                       args: [25 * Math.PI / 180]
-               }, {
-                       name: 'beginPath',
-                       args: []
-               }, {
-                       name: 'moveTo',
-                       args: [0 - 3 * 2 / Math.sqrt(3) / 2, 0 + 3 * 2 / Math.sqrt(3) * Math.sqrt(3) / 2 / 3]
-               }, {
-                       name: 'lineTo',
-                       args: [0 + 3 * 2 / Math.sqrt(3) / 2, 0 + 3 * 2 / Math.sqrt(3) * Math.sqrt(3) / 2 / 3],
-               }, {
-                       name: 'lineTo',
-                       args: [0, 0 - 2 * 3 * 2 / Math.sqrt(3) * Math.sqrt(3) / 2 / 3],
-               }, {
-                       name: 'closePath',
-                       args: [],
-               }, {
-                       name: 'fill',
-                       args: [],
-               }, {
-                       name: 'stroke',
-                       args: []
-               }, {
-                       name: 'restore',
-                       args: []
-               }]);
-
-               mockContext.resetCalls();
-               point._view.pointStyle = 'rect';
-               point.draw();
-
-               expect(mockContext.getCalls()).toEqual([{
-                       name: 'setStrokeStyle',
-                       args: ['rgba(1, 2, 3, 1)']
-               }, {
-                       name: 'setLineWidth',
-                       args: [6]
-               }, {
-                       name: 'setFillStyle',
-                       args: ['rgba(0, 255, 0)']
-               }, {
-                       name: 'save',
-                       args: []
-               }, {
-                       name: 'translate',
-                       args: [10, 15]
-               }, {
-                       name: 'rotate',
-                       args: [25 * Math.PI / 180]
-               }, {
-                       name: 'beginPath',
-                       args: []
-               }, {
-                       name: 'rect',
-                       args: [0 - 1 / Math.SQRT2 * 2, 0 - 1 / Math.SQRT2 * 2, 2 / Math.SQRT2 * 2, 2 / Math.SQRT2 * 2]
-               }, {
-                       name: 'fill',
-                       args: []
-               }, {
-                       name: 'stroke',
-                       args: []
-               }, {
-                       name: 'restore',
-                       args: []
-               }]);
-
-               var drawRoundedRectangleSpy = jasmine.createSpy('drawRoundedRectangle');
-               var drawRoundedRectangle = Chart.helpers.canvas.roundedRect;
-               var offset = point._view.radius / Math.SQRT2;
-               Chart.helpers.canvas.roundedRect = drawRoundedRectangleSpy;
-               mockContext.resetCalls();
-               point._view.pointStyle = 'rectRounded';
-               point.draw();
-
-               expect(drawRoundedRectangleSpy).toHaveBeenCalledWith(
-                       mockContext,
-                       0 - offset,
-                       0 - offset,
-                       Math.SQRT2 * 2,
-                       Math.SQRT2 * 2,
-                       2 * 0.425
-               );
-               expect(mockContext.getCalls()).toContain(
-                       jasmine.objectContaining({
-                               name: 'fill',
-                               args: [],
-                       })
-               );
-
-               Chart.helpers.canvas.roundedRect = drawRoundedRectangle;
-               mockContext.resetCalls();
-               point._view.pointStyle = 'rectRot';
-               point.draw();
-
-               expect(mockContext.getCalls()).toEqual([{
-                       name: 'setStrokeStyle',
-                       args: ['rgba(1, 2, 3, 1)']
-               }, {
-                       name: 'setLineWidth',
-                       args: [6]
-               }, {
-                       name: 'setFillStyle',
-                       args: ['rgba(0, 255, 0)']
-               }, {
-                       name: 'save',
-                       args: []
-               }, {
-                       name: 'translate',
-                       args: [10, 15]
-               }, {
-                       name: 'rotate',
-                       args: [25 * Math.PI / 180]
-               }, {
-                       name: 'beginPath',
-                       args: []
-               }, {
-                       name: 'moveTo',
-                       args: [0 - 1 / Math.SQRT2 * 2, 0]
-               }, {
-                       name: 'lineTo',
-                       args: [0, 0 + 1 / Math.SQRT2 * 2]
-               }, {
-                       name: 'lineTo',
-                       args: [0 + 1 / Math.SQRT2 * 2, 0],
-               }, {
-                       name: 'lineTo',
-                       args: [0, 0 - 1 / Math.SQRT2 * 2],
-               }, {
-                       name: 'closePath',
-                       args: []
-               }, {
-                       name: 'fill',
-                       args: [],
-               }, {
-                       name: 'stroke',
-                       args: []
-               }, {
-                       name: 'restore',
-                       args: []
-               }]);
-
-               mockContext.resetCalls();
-               point._view.pointStyle = 'cross';
-               point.draw();
-
-               expect(mockContext.getCalls()).toEqual([{
-                       name: 'setStrokeStyle',
-                       args: ['rgba(1, 2, 3, 1)']
-               }, {
-                       name: 'setLineWidth',
-                       args: [6]
-               }, {
-                       name: 'setFillStyle',
-                       args: ['rgba(0, 255, 0)']
-               }, {
-                       name: 'save',
-                       args: []
-               }, {
-                       name: 'translate',
-                       args: [10, 15]
-               }, {
-                       name: 'rotate',
-                       args: [25 * Math.PI / 180]
-               }, {
-                       name: 'beginPath',
-                       args: []
-               }, {
-                       name: 'moveTo',
-                       args: [0, 2]
-               }, {
-                       name: 'lineTo',
-                       args: [0, -2],
-               }, {
-                       name: 'moveTo',
-                       args: [-2, 0],
-               }, {
-                       name: 'lineTo',
-                       args: [2, 0],
-               }, {
-                       name: 'fill',
-                       args: []
-               }, {
-                       name: 'stroke',
-                       args: []
-               }, {
-                       name: 'restore',
-                       args: []
-               }]);
-
-               mockContext.resetCalls();
-               point._view.pointStyle = 'crossRot';
-               point.draw();
-
-               expect(mockContext.getCalls()).toEqual([{
-                       name: 'setStrokeStyle',
-                       args: ['rgba(1, 2, 3, 1)']
-               }, {
-                       name: 'setLineWidth',
-                       args: [6]
-               }, {
-                       name: 'setFillStyle',
-                       args: ['rgba(0, 255, 0)']
-               }, {
-                       name: 'save',
-                       args: []
-               }, {
-                       name: 'translate',
-                       args: [10, 15]
-               }, {
-                       name: 'rotate',
-                       args: [25 * Math.PI / 180]
-               }, {
-                       name: 'beginPath',
-                       args: []
-               }, {
-                       name: 'moveTo',
-                       args: [0 - Math.cos(Math.PI / 4) * 2, 0 - Math.sin(Math.PI / 4) * 2]
-               }, {
-                       name: 'lineTo',
-                       args: [0 + Math.cos(Math.PI / 4) * 2, 0 + Math.sin(Math.PI / 4) * 2],
-               }, {
-                       name: 'moveTo',
-                       args: [0 - Math.cos(Math.PI / 4) * 2, 0 + Math.sin(Math.PI / 4) * 2],
-               }, {
-                       name: 'lineTo',
-                       args: [0 + Math.cos(Math.PI / 4) * 2, 0 - Math.sin(Math.PI / 4) * 2],
-               }, {
-                       name: 'fill',
-                       args: []
-               }, {
-                       name: 'stroke',
-                       args: []
-               }, {
-                       name: 'restore',
-                       args: []
-               }]);
-
-               mockContext.resetCalls();
-               point._view.pointStyle = 'star';
-               point.draw();
-
-               expect(mockContext.getCalls()).toEqual([{
-                       name: 'setStrokeStyle',
-                       args: ['rgba(1, 2, 3, 1)']
-               }, {
-                       name: 'setLineWidth',
-                       args: [6]
-               }, {
-                       name: 'setFillStyle',
-                       args: ['rgba(0, 255, 0)']
-               }, {
-                       name: 'save',
-                       args: []
-               }, {
-                       name: 'translate',
-                       args: [10, 15]
-               }, {
-                       name: 'rotate',
-                       args: [25 * Math.PI / 180]
-               }, {
-                       name: 'beginPath',
-                       args: []
-               }, {
-                       name: 'moveTo',
-                       args: [0, 2]
-               }, {
-                       name: 'lineTo',
-                       args: [0, -2],
-               }, {
-                       name: 'moveTo',
-                       args: [-2, 0],
-               }, {
-                       name: 'lineTo',
-                       args: [2, 0],
-               }, {
-                       name: 'moveTo',
-                       args: [0 - Math.cos(Math.PI / 4) * 2, 0 - Math.sin(Math.PI / 4) * 2]
-               }, {
-                       name: 'lineTo',
-                       args: [0 + Math.cos(Math.PI / 4) * 2, 0 + Math.sin(Math.PI / 4) * 2],
-               }, {
-                       name: 'moveTo',
-                       args: [0 - Math.cos(Math.PI / 4) * 2, 0 + Math.sin(Math.PI / 4) * 2],
-               }, {
-                       name: 'lineTo',
-                       args: [0 + Math.cos(Math.PI / 4) * 2, 0 - Math.sin(Math.PI / 4) * 2],
-               }, {
-                       name: 'fill',
-                       args: []
-               }, {
-                       name: 'stroke',
-                       args: []
-               }, {
-                       name: 'restore',
-                       args: []
-               }]);
-
-               mockContext.resetCalls();
-               point._view.pointStyle = 'line';
-               point.draw();
-
-               expect(mockContext.getCalls()).toEqual([{
-                       name: 'setStrokeStyle',
-                       args: ['rgba(1, 2, 3, 1)']
-               }, {
-                       name: 'setLineWidth',
-                       args: [6]
-               }, {
-                       name: 'setFillStyle',
-                       args: ['rgba(0, 255, 0)']
-               }, {
-                       name: 'save',
-                       args: []
-               }, {
-                       name: 'translate',
-                       args: [10, 15]
-               }, {
-                       name: 'rotate',
-                       args: [25 * Math.PI / 180]
-               }, {
-                       name: 'beginPath',
-                       args: []
-               }, {
-                       name: 'moveTo',
-                       args: [-2, 0]
-               }, {
-                       name: 'lineTo',
-                       args: [2, 0],
-               }, {
-                       name: 'fill',
-                       args: []
-               }, {
-                       name: 'stroke',
-                       args: []
-               }, {
-                       name: 'restore',
-                       args: []
-               }]);
-
-               mockContext.resetCalls();
-               point._view.pointStyle = 'dash';
-               point.draw();
-
-               expect(mockContext.getCalls()).toEqual([{
-                       name: 'setStrokeStyle',
-                       args: ['rgba(1, 2, 3, 1)']
-               }, {
-                       name: 'setLineWidth',
-                       args: [6]
-               }, {
-                       name: 'setFillStyle',
-                       args: ['rgba(0, 255, 0)']
-               }, {
-                       name: 'save',
-                       args: []
-               }, {
-                       name: 'translate',
-                       args: [10, 15]
-               }, {
-                       name: 'rotate',
-                       args: [25 * Math.PI / 180]
-               }, {
-                       name: 'beginPath',
-                       args: []
-               }, {
-                       name: 'moveTo',
-                       args: [0, 0]
-               }, {
-                       name: 'lineTo',
-                       args: [2, 0],
-               }, {
-                       name: 'fill',
-                       args: []
-               }, {
-                       name: 'stroke',
-                       args: []
-               }, {
-                       name: 'restore',
-                       args: []
-               }]);
-
-       });
-
        it ('should draw correctly with default settings if necessary', function() {
                var mockContext = window.createMockContext();
                var point = new Chart.elements.Point({