<?php

namespace Tests\Feature;

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

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

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

        $res->assertSee('data-role="po-quickfilter-renewal-missing-sub"', false);
        $res->assertSee('续费缺订阅', false);
        $res->assertSee('renewal_missing_subscription=1', false);
    }
}
