From d34d281dd80c35332af3d7375a579827ece6cab9 Mon Sep 17 00:00:00 2001 From: Alexander Reifschneider <alexander.reifschneider@mgm-tp.com> Date: Fri, 21 Feb 2025 15:29:26 +0100 Subject: [PATCH] OZG-7619 move function --- .../src/lib/tooltip/tooltip.directive.spec.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/alfa-client/libs/design-system/src/lib/tooltip/tooltip.directive.spec.ts b/alfa-client/libs/design-system/src/lib/tooltip/tooltip.directive.spec.ts index a2d407a171..62a44e67c7 100644 --- a/alfa-client/libs/design-system/src/lib/tooltip/tooltip.directive.spec.ts +++ b/alfa-client/libs/design-system/src/lib/tooltip/tooltip.directive.spec.ts @@ -273,13 +273,6 @@ describe('TooltipDirective', () => { }); describe('setWidth', () => { - function setWidthOnComponentRef(width: number): void { - directive.componentRef = Object.assign(mockComponentRef, { - location: { - nativeElement: { children: [{ getBoundingClientRect: jest.fn().mockReturnValue({ width }) }] }, - }, - }); - } const maxTooltipWidth: number = MAX_WIDTH * REM; it('should set width to max width', () => { @@ -297,6 +290,14 @@ describe('TooltipDirective', () => { expect(directive.componentRef.instance.width).toBe(null); }); + + function setWidthOnComponentRef(width: number): void { + directive.componentRef = Object.assign(mockComponentRef, { + location: { + nativeElement: { children: [{ getBoundingClientRect: jest.fn().mockReturnValue({ width }) }] }, + }, + }); + } }); describe('setAutoPosition', () => { -- GitLab