From f0198841a99b4a0891bf0b157c7c9d8564a49092 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Mon, 16 Mar 2026 15:15:30 +0800 Subject: [PATCH] chore(admin-platform-order): add anchor id for relation subscription governance block --- .../admin/platform_orders/show.blade.php | 2 +- ...nSubscriptionBlockShouldHaveAnchorTest.php | 63 +++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 tests/Feature/AdminPlatformOrderShowRelationSubscriptionBlockShouldHaveAnchorTest.php diff --git a/resources/views/admin/platform_orders/show.blade.php b/resources/views/admin/platform_orders/show.blade.php index 4672f2e..57d3810 100644 --- a/resources/views/admin/platform_orders/show.blade.php +++ b/resources/views/admin/platform_orders/show.blade.php @@ -486,7 +486,7 @@ @endphp @if($isRenewalMissingSubscription) -
+
订阅关联治理提示
diff --git a/tests/Feature/AdminPlatformOrderShowRelationSubscriptionBlockShouldHaveAnchorTest.php b/tests/Feature/AdminPlatformOrderShowRelationSubscriptionBlockShouldHaveAnchorTest.php new file mode 100644 index 0000000..3b7081f --- /dev/null +++ b/tests/Feature/AdminPlatformOrderShowRelationSubscriptionBlockShouldHaveAnchorTest.php @@ -0,0 +1,63 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_show_relation_subscription_block_should_have_anchor_id(): void + { + $this->loginAsPlatformAdmin(); + + $merchant = Merchant::query()->firstOrFail(); + $plan = Plan::query()->create([ + 'code' => 'po_show_relation_anchor_plan', + 'name' => '关联订阅治理锚点测试套餐', + 'billing_cycle' => 'monthly', + 'price' => 30, + 'list_price' => 30, + 'status' => 'active', + 'sort' => 10, + 'published_at' => now(), + ]); + + $order = PlatformOrder::query()->create([ + 'merchant_id' => $merchant->id, + 'plan_id' => $plan->id, + 'order_no' => 'PO_SHOW_RELATION_ANCHOR_0001', + 'order_type' => 'renewal', + 'status' => 'pending', + 'payment_status' => 'unpaid', + 'plan_name' => $plan->name, + 'billing_cycle' => $plan->billing_cycle, + 'period_months' => 1, + 'quantity' => 1, + 'payable_amount' => 30, + 'paid_amount' => 0, + 'placed_at' => now(), + 'meta' => [], + ]); + + $res = $this->get('/admin/platform-orders/' . $order->id); + $res->assertOk(); + + $res->assertSee('id="relation-subscription"', false); + } +}