Files
saasshop/tests/Feature/AdminPlatformOrderToolsGovernanceHintTest.php

66 lines
2.3 KiB
PHP

<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminPlatformOrderToolsGovernanceHintTest 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_platform_orders_tools_show_governance_hint_when_reconcile_mismatch_filter_present(): void
{
$this->loginAsPlatformAdmin();
$this->get('/admin/platform-orders?reconcile_mismatch=1')
->assertOk()
->assertSee('建议先完成金额/状态治理(补回执/核对退款/修正状态)', false)
->assertSee('对账不一致', false);
}
public function test_platform_orders_tools_show_governance_hint_when_refund_inconsistent_filter_present(): void
{
$this->loginAsPlatformAdmin();
$this->get('/admin/platform-orders?refund_inconsistent=1')
->assertOk()
->assertSee('建议先完成金额/状态治理(补回执/核对退款/修正状态)', false)
->assertSee('退款不一致', false);
}
public function test_platform_orders_tools_show_strong_hint_when_syncable_only_and_governance_filters_present(): void
{
$this->loginAsPlatformAdmin();
$this->get('/admin/platform-orders?syncable_only=1&reconcile_mismatch=1')
->assertOk()
->assertSee('注意:当前同时勾选了「只看可同步」', false)
->assertSee('先去治理(取消只看可同步)', false)
->assertSee('syncable_only=', false);
}
public function test_platform_orders_tools_show_hint_when_sync_failed_filters_present(): void
{
$this->loginAsPlatformAdmin();
$this->get('/admin/platform-orders?sync_status=failed')
->assertOk()
->assertSee('当前筛选包含「同步失败/失败原因」范围', false)
->assertSee('进入同步失败集合', false)
->assertSee('切到只看可同步(用于批量重试同步)', false)
->assertSee('sync_status=failed', false)
->assertSee('syncable_only=1', false);
}
}