Skip to content
Snippets Groups Projects
Commit 1367e30d authored by OZGCloud's avatar OZGCloud
Browse files

Merge branch 'master' into OZG-7078-bugfix

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