admin-components: scope table-wrap min-width rule to platform-orders-table
This commit is contained in:
34
tests/Feature/AdminComponentsCssTableWrapScopeTest.php
Normal file
34
tests/Feature/AdminComponentsCssTableWrapScopeTest.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class AdminComponentsCssTableWrapScopeTest 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_table_wrap_min_width_rule_is_scoped_to_platform_orders_table(): void
|
||||
{
|
||||
$this->loginAsPlatformAdmin();
|
||||
|
||||
$css = file_get_contents(public_path('css/admin-components.css'));
|
||||
$this->assertIsString($css);
|
||||
|
||||
$this->assertStringContainsString('.table-wrap table.platform-orders-table{', $css);
|
||||
|
||||
// 避免对所有 table-wrap 下的 table 生效(影响其它页面表格)
|
||||
$this->assertStringNotContainsString("\n.table-wrap table{", $css);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user