MCPcopy Create free account
hub / github.com/angular/components / assertTooltipInstance

Function assertTooltipInstance

src/material/tooltip/tooltip.spec.ts:1701–1706  ·  view source on GitHub ↗

Asserts whether a tooltip directive has a tooltip instance.

(tooltip: MatTooltip, shouldExist: boolean)

Source from the content-addressed store, hash-verified

1699
1700/** Asserts whether a tooltip directive has a tooltip instance. */
1701function 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
1708function finishCurrentTooltipAnimation(overlayContainer: HTMLElement, isVisible: boolean) {
1709 const tooltip = overlayContainer.querySelector('.mat-mdc-tooltip')!;

Callers 1

tooltip.spec.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected