<?php

namespace Tests\Feature;

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

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

        $this->get('/admin/platform-orders')
            ->assertOk()
            ->assertSee('platform-orders-table is-compact', false)
            ->assertDontSee('platform-orders-table is-full', false);

        $this->get('/admin/platform-orders?view=full')
            ->assertOk()
            ->assertSee('platform-orders-table is-full', false)
            ->assertDontSee('platform-orders-table is-compact', false);
    }
}
