+
+ it('should not call plugins after uninstall', async function() {
+ const results = [];
+ const chart = window.acquireChart({
+ options: {
+ events: ['test'],
+ plugins: {
+ testPlugin: {
+ events: ['test']
+ }
+ }
+ },
+ plugins: [{
+ id: 'testPlugin',
+ reset: () => results.push('reset'),
+ afterDestroy: () => results.push('afterDestroy'),
+ uninstall: () => results.push('uninstall'),
+ }]
+ });
+ chart.reset();
+ expect(results).toEqual(['reset']);
+ chart.destroy();
+ expect(results).toEqual(['reset', 'afterDestroy', 'uninstall']);
+ chart.reset();
+ expect(results).toEqual(['reset', 'afterDestroy', 'uninstall']);
+ });