35 lines
698 B
PHP
35 lines
698 B
PHP
|
<?php
|
||
|
|
||
|
namespace Modules\Dashboard\Tests;
|
||
|
|
||
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||
|
use Livewire\Component;
|
||
|
use Livewire\Livewire;
|
||
|
use Tests\TestCase;
|
||
|
|
||
|
uses(DatabaseTransactions::class);
|
||
|
uses(TestCase::class);
|
||
|
|
||
|
it('renders successfully', function () {
|
||
|
$this->login()->loginNami();
|
||
|
|
||
|
Livewire::test(DummyComponent::class)
|
||
|
->assertSee('Testcontent')
|
||
|
->assertSee(auth()->user()->lastname);
|
||
|
});
|
||
|
|
||
|
class DummyComponent extends Component
|
||
|
{
|
||
|
|
||
|
public function render(): string
|
||
|
{
|
||
|
return <<<'HTML'
|
||
|
<div>
|
||
|
<x-page::layout>
|
||
|
Testcontent
|
||
|
</x-page::layout>
|
||
|
</div>
|
||
|
HTML;
|
||
|
}
|
||
|
}
|