From b8028fc11a872d28fab4fa1041cf0a51ee9142b7 Mon Sep 17 00:00:00 2001 From: stockiNail Date: Fri, 3 Jun 2022 16:25:08 +0200 Subject: [PATCH] Use getAnnotationElements utility where not used in the test cases --- test/specs/annotation.spec.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/test/specs/annotation.spec.js b/test/specs/annotation.spec.js index 1fb7c884b..6d1d49b35 100644 --- a/test/specs/annotation.spec.js +++ b/test/specs/annotation.spec.js @@ -161,8 +161,7 @@ describe('Annotation plugin', function() { } } }); - const state = window['chartjs-plugin-annotation']._getState(chart); - const element = state.elements[0]; + const element = window.getAnnotationElements(chart)[0]; expect(element.options.drawTime).toBe('fallback'); }); @@ -186,8 +185,7 @@ describe('Annotation plugin', function() { } } }); - const state = window['chartjs-plugin-annotation']._getState(chart); - const element = state.elements[0]; + const element = window.getAnnotationElements(chart)[0]; expect(element.options.drawTime).toBe('afterDatasetsDraw'); }); @@ -209,8 +207,7 @@ describe('Annotation plugin', function() { } } }); - const state = window['chartjs-plugin-annotation']._getState(chart); - const element = state.elements[0]; + const element = window.getAnnotationElements(chart)[0]; expect(element.options.drawTime).toBe(chart.options.plugins.annotation.annotations.label.drawTime); }); });