adrema/modules/Base/tests/PageLayoutTest.php

35 lines
698 B
PHP
Raw Normal View History

2024-09-24 01:26:08 +02:00
<?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;
}
}