Skip to content

Commit

Permalink
test(core): make pivot-sheet test pass
Browse files Browse the repository at this point in the history
  • Loading branch information
1wkk committed May 17, 2023
1 parent 1c54488 commit f8123f0
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -975,6 +975,7 @@ describe('PivotSheet Tests', () => {
s2.store.set('test', 111);

// restore mock...
s2.tooltip.show = jest.fn();
(s2.tooltip.show as jest.Mock).mockRestore();
s2.showTooltip({
position: {
Expand All @@ -984,7 +985,7 @@ describe('PivotSheet Tests', () => {
content: () => 'custom callback content',
});
s2.hideTooltip();
s2.tooltip.container.classList.add('destroy-test');
s2.tooltip.container?.classList.add('destroy-test');
s2.interaction.addIntercepts([InterceptType.HOVER]);
s2.interaction.interactions.set('test-interaction', null);
s2.container.on('test-event', () => {});
Expand All @@ -1005,7 +1006,7 @@ describe('PivotSheet Tests', () => {
expect(s2.interaction.eventController.domEventListeners).toHaveLength(0);
// destroy tooltip
expect(document.querySelector('.destroy-test')).toBe(null);
expect(s2.tooltip.container).toBe(null);
expect(s2.tooltip.container).toBe(undefined);
// destroy facet
expect(facetDestroySpy).toHaveBeenCalledTimes(1);
// destroy hdAdapter
Expand Down

0 comments on commit f8123f0

Please sign in to comment.