adrema/modules/Contribution/Components/FillListTest.php

36 lines
1010 B
PHP

<?php
namespace Modules\Contribution\Components;
use App\Contribution\Documents\RdpNrwDocument;
use App\Country;
use Tests\TestCase;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Livewire\Livewire;
uses(TestCase::class);
uses(DatabaseTransactions::class);
beforeEach(function () {
test()->login()->loginNami();
});
it('displays page', function () {
test()->get(route('contribution.index'))
->assertSeeLivewire(FillList::class);
});
it('displays fields', function () {
$country = Country::factory()->create(['name' => 'Deutschland']);
Livewire::test(FillList::class)
->assertSet('compilers.0.class', RdpNrwDocument::class)
->assertSet('compilers.0.title', 'Für RdP NRW erstellen')
->assertSet('countries.0.name', 'Deutschland')
->assertSet('countries.0.id', $country->id)
->assertSet('country', $country->id)
->assertSee('Veranstaltungs-Name')
->assertSee('Datum von')
->assertSee('Deutschland');
});