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 a2d407a171baab9b58be7d8c583ae9f8ebd73a0c..62a44e67c7f0a2d4f798791923b713ec71e92bc6 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', () => {