feat(admin-dashboard): sync trend/billing card height with recent orders

This commit is contained in:
萝卜
2026-03-16 23:29:45 +08:00
parent 9dc281f48e
commit 7f1d234393
4 changed files with 123 additions and 3 deletions

View File

@@ -0,0 +1,35 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminDashboardCardsHeightSyncRolesShouldRenderTest 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_height_sync_roles(): void
{
$this->loginAsPlatformAdmin();
$res = $this->get('/admin');
$res->assertOk();
$html = (string) $res->getContent();
$this->assertStringContainsString('data-role="dashboard-card-trend"', $html);
$this->assertStringContainsString('data-role="dashboard-card-billing-workbench"', $html);
$this->assertStringContainsString('data-role="dashboard-card-recent-platform-orders"', $html);
}
}

View File

@@ -0,0 +1,20 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminJsDashboardCardsHeightSyncShouldUseRecentOrdersHeightTest extends TestCase
{
use RefreshDatabase;
public function test_admin_js_should_include_dashboard_height_sync_selectors(): void
{
$js = (string) file_get_contents(public_path('js/admin.js'));
$this->assertStringContainsString('dashboard-card-recent-platform-orders', $js);
$this->assertStringContainsString('dashboard-card-trend', $js);
$this->assertStringContainsString('dashboard-card-billing-workbench', $js);
}
}