<?php

namespace Tests\Feature;

use Tests\TestCase;

class AdminCardGridShouldNotApplyCardPlusCardMarginTest extends TestCase
{
    public function test_admin_components_css_should_zero_margin_top_for_cards_inside_grids(): void
    {
        $css = (string) file_get_contents(public_path('css/admin-components.css'));

        // 护栏：grid 容器内的卡片必须清理 `.card + .card{margin-top:20px;}` 的纵向堆叠规则
        // 否则会导致同一行的第二张卡整体下沉，出现“卡片不在同一条线”。
        $this->assertStringContainsString('.grid > .card', $css);
        $this->assertStringContainsString('.grid-2 > .card', $css);
        $this->assertStringContainsString('.grid-3 > .card', $css);
        $this->assertStringContainsString('.grid-4 > .card', $css);
        $this->assertStringContainsString('.grid-5 > .card', $css);
        $this->assertStringContainsString('.grid-6 > .card', $css);
        $this->assertStringContainsString('margin-top:0', $css);
    }
}
