Skip to content

Commit 8352c68

Browse files
authored
Use getAnnotationElements utility where not used in the test cases (#757)
1 parent 990e148 commit 8352c68

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

test/specs/annotation.spec.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,7 @@ describe('Annotation plugin', function() {
161161
}
162162
}
163163
});
164-
const state = window['chartjs-plugin-annotation']._getState(chart);
165-
const element = state.elements[0];
164+
const element = window.getAnnotationElements(chart)[0];
166165
expect(element.options.drawTime).toBe('fallback');
167166
});
168167

@@ -186,8 +185,7 @@ describe('Annotation plugin', function() {
186185
}
187186
}
188187
});
189-
const state = window['chartjs-plugin-annotation']._getState(chart);
190-
const element = state.elements[0];
188+
const element = window.getAnnotationElements(chart)[0];
191189
expect(element.options.drawTime).toBe('afterDatasetsDraw');
192190
});
193191

@@ -209,8 +207,7 @@ describe('Annotation plugin', function() {
209207
}
210208
}
211209
});
212-
const state = window['chartjs-plugin-annotation']._getState(chart);
213-
const element = state.elements[0];
210+
const element = window.getAnnotationElements(chart)[0];
214211
expect(element.options.drawTime).toBe(chart.options.plugins.annotation.annotations.label.drawTime);
215212
});
216213
});

0 commit comments

Comments
 (0)