Skip to content

Commit

Permalink
Use getAnnotationElements utility where not used in the test cases (#757
Browse files Browse the repository at this point in the history
)
  • Loading branch information
stockiNail authored Jun 8, 2022
1 parent 990e148 commit 8352c68
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions test/specs/annotation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});

Expand All @@ -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');
});

Expand All @@ -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);
});
});
Expand Down

0 comments on commit 8352c68

Please sign in to comment.