<?php

namespace Tests\Feature;

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

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

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

        // 分页 hover/active 应统一走 primary tint/border token，避免散落 rgba 硬编码。
        $this->assertStringContainsString('background:var(--adm-primary-tint-06', $css);
        $this->assertStringContainsString('background:var(--adm-primary-tint-08', $css);
        $this->assertStringContainsString('border-color:var(--adm-primary-border-35', $css);
        $this->assertStringContainsString('border-color:var(--adm-primary-border-45', $css);
    }
}
