chore(governance): block batch mark activated when reconcile/refund inconsistent
This commit is contained in:
@@ -73,7 +73,10 @@ class AdminPlatformOrderBatchMarkActivatedReceiptStatusFilterFieldsTest extends
|
||||
|
||||
$res->assertRedirect();
|
||||
|
||||
// 口径升级:批量生效不再允许在“收费闭环缺口/需治理”的集合上直接推进
|
||||
$res->assertSessionHas('warning');
|
||||
|
||||
$order->refresh();
|
||||
$this->assertSame('activated', $order->status);
|
||||
$this->assertSame('pending', $order->status);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,8 +77,9 @@ class AdminPlatformOrderBatchMarkActivatedReconcileMismatchFilterFieldsTest exte
|
||||
]);
|
||||
|
||||
$res->assertRedirect();
|
||||
$res->assertSessionHas('warning');
|
||||
|
||||
$order->refresh();
|
||||
$this->assertSame('activated', $order->status);
|
||||
$this->assertSame('pending', $order->status);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class AdminPlatformOrderBatchMarkActivatedShouldBlockWhenRefundInconsistentTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
protected function loginAsPlatformAdmin(): void
|
||||
{
|
||||
$this->seed();
|
||||
|
||||
$this->post('/admin/login', [
|
||||
'email' => 'platform.admin@demo.local',
|
||||
'password' => 'Platform@123456',
|
||||
])->assertRedirect('/admin');
|
||||
}
|
||||
|
||||
public function test_batch_mark_activated_should_block_when_refund_inconsistent_is_set(): void
|
||||
{
|
||||
$this->loginAsPlatformAdmin();
|
||||
|
||||
$res = $this->post('/admin/platform-orders/batch-mark-activated', [
|
||||
'scope' => 'filtered',
|
||||
'payment_status' => 'paid',
|
||||
'status' => 'pending',
|
||||
'sync_status' => 'unsynced',
|
||||
'refund_inconsistent' => '1',
|
||||
'limit' => 50,
|
||||
]);
|
||||
|
||||
$res->assertRedirect();
|
||||
$res->assertSessionHas('warning');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class AdminPlatformOrderIndexBatchMarkActivatedButtonShouldDisableWhenRefundInconsistentTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
protected function loginAsPlatformAdmin(): void
|
||||
{
|
||||
$this->seed();
|
||||
|
||||
$this->post('/admin/login', [
|
||||
'email' => 'platform.admin@demo.local',
|
||||
'password' => 'Platform@123456',
|
||||
])->assertRedirect('/admin');
|
||||
}
|
||||
|
||||
public function test_batch_mark_activated_button_should_disable_when_refund_inconsistent_is_set_even_if_paid_pending(): void
|
||||
{
|
||||
$this->loginAsPlatformAdmin();
|
||||
|
||||
$res = $this->get('/admin/platform-orders?payment_status=paid&status=pending&sync_status=unsynced&refund_inconsistent=1');
|
||||
$res->assertOk();
|
||||
|
||||
$html = (string) $res->getContent();
|
||||
|
||||
$this->assertStringContainsString('批量仅标记为已生效(当前筛选范围)', $html);
|
||||
$this->assertStringContainsString('data-role="batch-mark-activated-blocked-hint"', $html);
|
||||
$this->assertStringContainsString('退款不一致', $html);
|
||||
|
||||
$this->assertTrue(str_contains($html, 'type="submit" disabled') || str_contains($html, 'disabled="disabled"'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user