ui(site-subscriptions): collapse filters by default in attach order mode
This commit is contained in:
@@ -262,7 +262,7 @@
|
||||
<div class="muted muted-xs mt-6">建议:先处理“7天内到期”续费触达,再处理“已过期”补单或关闭。</div>
|
||||
</div>
|
||||
|
||||
<details class="card mb-20 collapsible filters-card" data-role="collapsible" data-storage-key="admin.site_subscriptions.filters" open>
|
||||
<details class="card mb-20 collapsible filters-card" data-role="collapsible" data-storage-key="admin.site_subscriptions.filters" @if($attachOrderId<=0) open @endif>
|
||||
<summary class="collapsible-summary filters-summary">
|
||||
<div class="flex-between items-center">
|
||||
<h3 class="mb-0">筛选条件</h3>
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class AdminSiteSubscriptionIndexAttachOrderModeShouldCollapseFiltersByDefaultTest 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_attach_order_mode_should_not_open_filters_details_by_default(): void
|
||||
{
|
||||
$this->loginAsPlatformAdmin();
|
||||
|
||||
$res = $this->get('/admin/site-subscriptions?attach_order_id=123&attach_back=%2Fadmin%2Fplatform-orders%2F123');
|
||||
$res->assertOk();
|
||||
|
||||
$html = (string) $res->getContent();
|
||||
|
||||
// attach_order 模式:filters-card 不应默认 open(减少干扰)
|
||||
$this->assertStringContainsString('data-storage-key="admin.site_subscriptions.filters"', $html);
|
||||
|
||||
// 简单但有效:断言该 details 标签不含 open 属性
|
||||
$this->assertStringNotContainsString('data-storage-key="admin.site_subscriptions.filters" open', $html);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user