From: Jukka Kurkela Date: Thu, 1 Apr 2021 15:11:14 +0000 (+0300) Subject: Fix typo, add tests to catch (#8768) X-Git-Tag: v3.0.0-rc.7~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9fb18c2fd775d7403e34a3c5ea160db9393319b8;p=thirdparty%2FChart.js.git Fix typo, add tests to catch (#8768) * Fix typo, add tests to catch * Tune tests --- diff --git a/src/elements/element.arc.js b/src/elements/element.arc.js index 37d662525..376b8ebe9 100644 --- a/src/elements/element.arc.js +++ b/src/elements/element.arc.js @@ -41,7 +41,7 @@ function drawArc(ctx, element) { ctx.fill(); } } - if (!isNaN(element.curcumference)) { + if (!isNaN(element.circumference)) { element.endAngle = element.startAngle + element.circumference % TAU; } diff --git a/test/fixtures/controller.doughnut/single-slice-circumference-405.js b/test/fixtures/controller.doughnut/single-slice-circumference-405.js new file mode 100644 index 000000000..639d75714 --- /dev/null +++ b/test/fixtures/controller.doughnut/single-slice-circumference-405.js @@ -0,0 +1,21 @@ +module.exports = { + threshold: 0.05, + config: { + type: 'doughnut', + data: { + labels: ['A'], + datasets: [{ + data: [1], + backgroundColor: 'rgba(0,0,0,0.3)', + borderColor: 'rgba(0,0,0,0.5)', + circumference: 405 + }] + }, + }, + options: { + canvas: { + width: 256, + height: 256 + } + } +}; diff --git a/test/fixtures/controller.doughnut/single-slice-circumference-405.png b/test/fixtures/controller.doughnut/single-slice-circumference-405.png new file mode 100644 index 000000000..0591cca94 Binary files /dev/null and b/test/fixtures/controller.doughnut/single-slice-circumference-405.png differ diff --git a/test/fixtures/controller.doughnut/single-slice-opacity.js b/test/fixtures/controller.doughnut/single-slice-opacity.js new file mode 100644 index 000000000..8dd6dab15 --- /dev/null +++ b/test/fixtures/controller.doughnut/single-slice-opacity.js @@ -0,0 +1,20 @@ +module.exports = { + threshold: 0.05, + config: { + type: 'doughnut', + data: { + labels: ['A'], + datasets: [{ + data: [1], + backgroundColor: 'rgba(0,0,0,0.3)', + borderColor: 'rgba(0,0,0,0.5)' + }] + }, + }, + options: { + canvas: { + width: 256, + height: 256 + } + } +}; diff --git a/test/fixtures/controller.doughnut/single-slice-opacity.png b/test/fixtures/controller.doughnut/single-slice-opacity.png new file mode 100644 index 000000000..9a55d1ca1 Binary files /dev/null and b/test/fixtures/controller.doughnut/single-slice-opacity.png differ