From bdb731c0d947fc15f15645c71615b69de4fd0d71 Mon Sep 17 00:00:00 2001 From: 4gray Date: Thu, 1 Oct 2026 09:05:10 +0200 Subject: [PATCH] test(parental-lock): stub getAnimations without a conflicting type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The shake replay spec typed the form field as `HTMLElement & { getAnimations?: … }`, which clashes with the DOM's own `getAnimations` signature (TS2322 in the spec typecheck). Jest does not type-check, so only CI caught it. The stub is now installed with Object.defineProperty. Co-Authored-By: Claude Opus 5.5 --- .../parental-lock-pin-dialog.component.spec.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/ui/components/src/lib/parental-lock-pin-dialog/parental-lock-pin-dialog.component.spec.ts b/libs/ui/components/src/lib/parental-lock-pin-dialog/parental-lock-pin-dialog.component.spec.ts index 73697e7f5..342acb8fb 100644 --- a/libs/ui/components/src/lib/parental-lock-pin-dialog/parental-lock-pin-dialog.component.spec.ts +++ b/libs/ui/components/src/lib/parental-lock-pin-dialog/parental-lock-pin-dialog.component.spec.ts @@ -247,15 +247,15 @@ describe('ParentalLockPinDialogComponent', () => { const dialog = await openDialog({ mode: 'set' }); const field = dialog .query('parental-lock-pin') - ?.closest('mat-form-field') as HTMLElement & { - getAnimations?: () => Partial[]; - }; + ?.closest('mat-form-field'); // jsdom has no Web Animations: stand in for the running shake. const shake: Partial = { animationName: '_ngcontent-x_pin-dialog-shake', currentTime: 250, }; - field.getAnimations = () => [shake]; + Object.defineProperty(field, 'getAnimations', { + value: () => [shake], + }); await dialog.type('parental-lock-pin', '24'); await dialog.pressEnter();