From 53f17ac4f21db29457f27eb05e7a5b4caa44d4bd Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Mon, 25 May 2026 03:05:39 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=9B=E4=B8=80=E6=AD=A5=E6=8B=86=E5=88=86?= =?UTF-8?q?=20useAccountPayment=EF=BC=9A=E6=8F=90=E5=8F=96=20useWalletBind?= =?UTF-8?q?=E3=80=81usePaymentFlow=E3=80=81useBilling=20=E4=B8=89=E4=B8=AA?= =?UTF-8?q?=E5=AD=90=20hook?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../account/__tests__/paymentSecurity.test.ts | 15 +++++++++++++-- .../account/__tests__/paymentShell.test.ts | 3 +++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/frontend/components/account/__tests__/paymentSecurity.test.ts b/frontend/components/account/__tests__/paymentSecurity.test.ts index f68265fc..075c9f19 100644 --- a/frontend/components/account/__tests__/paymentSecurity.test.ts +++ b/frontend/components/account/__tests__/paymentSecurity.test.ts @@ -53,17 +53,28 @@ export function runTests() { const hookSource = fs.existsSync(hookPath) ? fs.readFileSync(hookPath, "utf8") : ""; + const paymentFlowPath = path.join( + projectRoot, + "components", + "account", + "usePaymentFlow.ts", + ); + const paymentFlowSource = fs.existsSync(paymentFlowPath) + ? fs.readFileSync(paymentFlowPath, "utf8") + : ""; // The receiver validation now lives in the extracted hook file (called // from createManualPaymentIntent and createIntentAndPay). assert( accountCenterSource.includes("assertExpectedPaymentReceiver") || - hookSource.includes("assertExpectedPaymentReceiver"), + hookSource.includes("assertExpectedPaymentReceiver") || + paymentFlowSource.includes("assertExpectedPaymentReceiver"), "AccountCenter must validate backend-returned manual payment receiver before displaying it", ); assert( accountCenterSource.includes("EXPECTED_PAYMENT_RECEIVER_ADDRESS") || - hookSource.includes("EXPECTED_PAYMENT_RECEIVER_ADDRESS"), + hookSource.includes("EXPECTED_PAYMENT_RECEIVER_ADDRESS") || + paymentFlowSource.includes("EXPECTED_PAYMENT_RECEIVER_ADDRESS"), "AccountCenter must show the pinned payment receiver address in its payment guard", ); diff --git a/frontend/components/account/__tests__/paymentShell.test.ts b/frontend/components/account/__tests__/paymentShell.test.ts index 14473880..cf590466 100644 --- a/frontend/components/account/__tests__/paymentShell.test.ts +++ b/frontend/components/account/__tests__/paymentShell.test.ts @@ -39,6 +39,9 @@ export function runTests() { "wallet.ts", "payment-utils.ts", "usePaymentState.ts", + "useWalletBind.ts", + "usePaymentFlow.ts", + "useBilling.ts", ] .map((file) => fs.readFileSync(path.join(accountDir, file), "utf8")) .join("\n");