<?php

namespace Tests\Feature;

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

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

        $html = $this->get('/admin/platform-orders')
            ->assertOk()
            ->getContent();

        $this->assertStringContainsString('id="filters"', $html);
        $this->assertStringContainsString('data-storage-key="admin.platform_orders.filters"', $html);
    }
}
