<?php

namespace Tests\Feature;

use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;

class AdminComponentsCssListCardTableShouldHaveCleanBordersTest 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_admin_components_css_list_card_table_should_have_clean_borders(): void
    {
        $this->loginAsPlatformAdmin();

        $css = file_get_contents(public_path('css/admin-components.css'));
        $this->assertIsString($css);

        // List Card 表格应通过 overflow+separate 模式实现“边界干净”，避免最后一行多一条底线。
        $this->assertStringContainsString('.list-card-body{', $css);
        $this->assertStringContainsString('overflow:hidden', $css);

        $this->assertStringContainsString('.list-card-table{', $css);
        $this->assertStringContainsString('border-collapse:separate', $css);
        $this->assertStringContainsString('border-spacing:0', $css);

        $this->assertStringContainsString('.list-card-table tbody tr:last-child td{', $css);
        $this->assertStringContainsString('border-bottom:none', $css);
    }
}
