From 00a1155f5a446d047c4113824bacbf7620c8caed Mon Sep 17 00:00:00 2001 From: lsdsjy <1356263+lsdsjy@users.noreply.github.com> Date: Fri, 16 Oct 2026 18:26:26 +0800 Subject: [PATCH] =?UTF-8?q?test(account):=20=E4=BF=AE=E5=A4=8D=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E5=8A=A8=E7=94=BB=E6=B5=8B=E8=AF=95=E7=9A=84=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E6=84=9F=E7=9F=A5=20lint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tests/notice-transition.client.spec.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/client/ui-settings-account/tests/notice-transition.client.spec.ts b/packages/client/ui-settings-account/tests/notice-transition.client.spec.ts index 9cac26b052..0f69d1b0bf 100644 --- a/packages/client/ui-settings-account/tests/notice-transition.client.spec.ts +++ b/packages/client/ui-settings-account/tests/notice-transition.client.spec.ts @@ -13,7 +13,7 @@ it.each(['unavailable', 'reduced motion'])('closes without animation when animat card.animate = animate card.style.transitionDuration = '0s' } - const dismiss = vi.fn(() => card.remove()) + const dismiss = vi.fn(() => { card.remove() }) dismissNotice(card, dismiss) expect(dismiss).toHaveBeenCalledOnce() expect(animate).not.toHaveBeenCalled() @@ -26,8 +26,10 @@ it('animates a surviving card from its old position and height and cancels an in stack.append(first, next) document.body.append(stack) first.style.transitionDuration = '0.25s' - first.animate = vi.fn() - next.animate = vi.fn() + const animateFirst = vi.fn() + const animateNext = vi.fn() + first.animate = animateFirst + next.animate = animateNext first.getAnimations = () => [] const cancel = vi.fn() const interrupted: Pick = { cancel } @@ -36,10 +38,10 @@ it('animates a surviving card from its old position and height and cancels an in .mockReturnValueOnce(new DOMRect(14, 196, 272, 100)) .mockReturnValueOnce(new DOMRect(10, 100, 280, 200)) next.style.transform = 'translateY(0px) scaleX(1)' - dismissNotice(first, () => first.remove()) + dismissNotice(first, () => { first.remove() }) expect(cancel).toHaveBeenCalledOnce() - expect(first.animate).not.toHaveBeenCalled() - expect(next.animate).toHaveBeenCalledWith([ + expect(animateFirst).not.toHaveBeenCalled() + expect(animateNext).toHaveBeenCalledWith([ { transform: 'translate(0px, 96px) scale(0.9714285714285714, 0.5)' }, { transform: 'translateY(0px) scaleX(1)' }, ], { duration: 250, easing: 'ease-out' })