修复平台订单快捷筛选重复锚点冲突

This commit is contained in:
萝卜
2026-03-19 10:55:30 +08:00
parent 4f046a1820
commit 7bd33d0c85
2 changed files with 37 additions and 4 deletions

View File

@@ -0,0 +1,33 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminPlatformOrderIndexShouldHaveSingleQuickFiltersAnchorTest 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_index_should_have_single_quick_filters_anchor(): void
{
$this->loginAsPlatformAdmin();
$res = $this->get('/admin/platform-orders');
$res->assertOk();
$html = (string) $res->getContent();
$count = substr_count($html, 'id="po-quick-filters"');
$this->assertSame(1, $count, 'po-quick-filters 锚点应只出现一次,避免页面内锚点冲突。');
}
}