From 7bc2fa916a2c655b9909db80cfe66da294d15ab7 Mon Sep 17 00:00:00 2001 From: dwebxr Date: Mon, 21 Sep 2026 22:31:28 +0900 Subject: [PATCH] =?UTF-8?q?test(tip):=20Avalanche=20=E3=83=81=E3=83=83?= =?UTF-8?q?=E3=83=97=E3=81=AE=E3=83=86=E3=82=B9=E3=83=88=E3=81=A7=E9=81=85?= =?UTF-8?q?=E5=BB=B6=20import=20=E3=81=AE=20TipForm=20=E3=82=92=E5=A2=83?= =?UTF-8?q?=E7=95=8C=20mock=20=E3=81=AB=E3=81=99=E3=82=8B=20(=E6=9C=AA?= =?UTF-8?q?=E5=87=A6=E7=90=86=E4=BE=8B=E5=A4=96=E3=81=A7=20exit=201=20?= =?UTF-8?q?=E3=81=AB=E3=81=AA=E3=82=8B=20flake)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit プレビューの TipForm は next/dynamic の遅延 import。実物は このファイルの wagmi mock に 無い hook (useSwitchChain 等) を呼ぶため、読み込みがテスト終了と重なると未処理例外になり、 全 test pass のまま vitest が exit 1 になることがあった。 対象は chain chip の描画と URL なので、既存 TipEmbedGenerator.test と同じく @/components/TipForm を境界で切る。製品コードの変更なし。 Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01HeizmagJBgL5peL5mQpxkc --- tests/components/TipEmbedGeneratorAvalanche.test.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/components/TipEmbedGeneratorAvalanche.test.tsx b/tests/components/TipEmbedGeneratorAvalanche.test.tsx index ac398b62..c2853187 100644 --- a/tests/components/TipEmbedGeneratorAvalanche.test.tsx +++ b/tests/components/TipEmbedGeneratorAvalanche.test.tsx @@ -21,6 +21,12 @@ vi.mock('@/hooks/useResolveAddress', () => ({ vi.mock('wagmi', () => ({ useAccount: vi.fn(() => ({ address: undefined, isConnected: false })), })); +// プレビューの TipForm は遅延 import で、実物は上の wagmi mock に無い hook (useSwitchChain 等) を呼ぶ。 +// 読み込みがテスト終了と重なると未処理例外になり、全 test pass のまま exit 1 になっていた。 +// このファイルの対象は chain chip なので、既存 TipEmbedGenerator.test と同じく境界で切る。 +vi.mock('@/components/TipForm', () => ({ + TipForm: () => null, +})); let cleanupFn: (() => void) | null = null;