<?php

namespace Tests\Feature;

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

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

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

        $res->assertSee('name="created_from"', false);
        $res->assertSee('type="date"', false);
        $res->assertSee('data-role="po-created-from"', false);

        $res->assertSee('name="created_to"', false);
        $res->assertSee('type="date"', false);
        $res->assertSee('data-role="po-created-to"', false);
    }
}
