<?php

namespace Tests\Feature;

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

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

        $res = $this->get('/admin/site-subscriptions?expiry=expired&ends_from=2026-03-01&ends_to=2026-03-31');
        $res->assertOk();

        $res->assertSee('name="ends_from" value="2026-03-01"', false);
        $res->assertSee('name="ends_to" value="2026-03-31"', false);
    }
}
