Asserts whether a tooltip directive has a tooltip instance.
(tooltip: MatTooltip, shouldExist: boolean)
| 1689 | |
| 1690 | /** Asserts whether a tooltip directive has a tooltip instance. */ |
| 1691 | function assertTooltipInstance(tooltip: MatTooltip, shouldExist: boolean): void { |
| 1692 | // Note that we have to cast this to a boolean, because Jasmine will go into an infinite loop |
| 1693 | // if it tries to stringify the `_tooltipInstance` when an assertion fails. The infinite loop |
| 1694 | // happens due to the `_tooltipInstance` having a circular structure. |
| 1695 | expect(!!tooltip._tooltipInstance).toBe(shouldExist); |
| 1696 | } |
| 1697 | |
| 1698 | function finishCurrentTooltipAnimation(overlayContainer: HTMLElement, isVisible: boolean) { |
| 1699 | const tooltip = overlayContainer.querySelector('.mat-mdc-tooltip')!; |