Asserts whether a tooltip directive has a tooltip instance.
(tooltip: MatTooltip, shouldExist: boolean)
| 1699 | |
| 1700 | /** Asserts whether a tooltip directive has a tooltip instance. */ |
| 1701 | function assertTooltipInstance(tooltip: MatTooltip, shouldExist: boolean): void { |
| 1702 | // Note that we have to cast this to a boolean, because Jasmine will go into an infinite loop |
| 1703 | // if it tries to stringify the `_tooltipInstance` when an assertion fails. The infinite loop |
| 1704 | // happens due to the `_tooltipInstance` having a circular structure. |
| 1705 | expect(!!tooltip._tooltipInstance).toBe(shouldExist); |
| 1706 | } |
| 1707 | |
| 1708 | function finishCurrentTooltipAnimation(overlayContainer: HTMLElement, isVisible: boolean) { |
| 1709 | const tooltip = overlayContainer.querySelector('.mat-mdc-tooltip')!; |