ui(component): metric_explain默认折叠(details)避免Dashboard口径说明撑满
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class AdminMetricExplainComponentShouldUseDetailsByDefaultTest 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_dashboard_should_render_metric_explain_as_details(): void
|
||||
{
|
||||
$this->loginAsPlatformAdmin();
|
||||
|
||||
$res = $this->get('/admin');
|
||||
|
||||
$res->assertOk();
|
||||
// 组件默认应使用 details 折叠,避免口径说明撑满页面。
|
||||
$res->assertSee('data-role="metric-explain"', false);
|
||||
$res->assertSee('<details', false);
|
||||
$res->assertSee('点击展开');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user