<?php

namespace Tests\Feature;

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

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

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

        $this->assertStringContainsString('--adm-primary-tint-04', $css);
        $this->assertStringContainsString('--adm-primary-tint-06', $css);
        $this->assertStringContainsString('--adm-primary-tint-08', $css);
        $this->assertStringContainsString('--adm-primary-border-35', $css);
        $this->assertStringContainsString('--adm-primary-border-45', $css);
    }
}
