Skip to content
Snippets Groups Projects
Commit 98a218c6 authored by OZGCloud's avatar OZGCloud
Browse files

Merge pull request 'OZG-7047 OZG-7347 fix tooltip initialisation' (#862) from...

Merge pull request 'OZG-7047 OZG-7347 fix tooltip initialisation' (#862) from OZG-7047-tooltip-improvement into master

Reviewed-on: https://git.ozg-sh.de/ozgcloud-app/alfa/pulls/862


Reviewed-by: default avatarOZGCloud <ozgcloud@mgm-tp.com>
parents 2466072c 117e373a
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,7 @@ import { iconVariants, IconVariants } from '../iconVariants';
viewBox="0 0 26 26"
[ngClass]="[twMerge(iconVariants({ size }), 'fill-neutral-500 dark:fill-neutral-400', class)]"
xmlns="http://www.w3.org/2000/svg"
aria-hidden="true"
>
<rect x="2" y="2" width="22" height="22" rx="11" />
<path
......
......@@ -61,6 +61,16 @@ describe('TooltipDirective', () => {
expect(directive).toBeTruthy();
});
describe('ngAfterViewInit', () => {
it('should create tooltip', () => {
directive.createTooltip = jest.fn();
directive.ngAfterViewInit();
expect(directive.createTooltip).toHaveBeenCalled();
});
});
describe('ngOnDestroy', () => {
it('should destroy tooltip', () => {
directive.destroy = jest.fn();
......
......@@ -24,6 +24,7 @@
import { isEscapeKey, isNotNull } from '@alfa-client/tech-shared';
import { InteractivityChecker } from '@angular/cdk/a11y';
import {
AfterViewInit,
ComponentRef,
Directive,
ElementRef,
......@@ -31,7 +32,6 @@ import {
inject,
Input,
OnDestroy,
OnInit,
Renderer2,
ViewContainerRef,
} from '@angular/core';
......@@ -44,7 +44,7 @@ const OUTLINE_INDENT = 4; // Outline offset (2) + outline width (2)
selector: '[tooltip]',
standalone: true,
})
export class TooltipDirective implements OnInit, OnDestroy {
export class TooltipDirective implements AfterViewInit, OnDestroy {
@Input() tooltip: string = '';
componentRef: ComponentRef<TooltipComponent> = null;
......@@ -56,7 +56,7 @@ export class TooltipDirective implements OnInit, OnDestroy {
public renderer: Renderer2 = inject(Renderer2);
public interactivityChecker: InteractivityChecker = inject(InteractivityChecker);
ngOnInit(): void {
ngAfterViewInit(): void {
this.createTooltip();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment