<?php

use App\Filament\Resources\BrentPriceResource\Pages\ListBrentPrices;
use App\Models\BrentPrice;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Livewire\Livewire;

uses(RefreshDatabase::class);

beforeEach(function () {
    $this->admin = User::factory()->admin()->create();
    $this->actingAs($this->admin);
});

it('renders the brent price list', function () {
    $prices = BrentPrice::factory()->count(3)->create();

    Livewire::test(ListBrentPrices::class)
        ->assertOk()
        ->assertCanSeeTableRecords($prices);
});
