flowtodo/tests/Feature/Auth/RegistrationTest.php
Javier Feliz 0ddd325281
Some checks are pending
linter / quality (push) Waiting to run
tests / ci (push) Waiting to run
Initial commit
2025-07-15 18:28:47 -04:00

27 lines
698 B
PHP

<?php
use App\Livewire\Auth\Register;
use Livewire\Livewire;
uses(\Illuminate\Foundation\Testing\RefreshDatabase::class);
test('registration screen can be rendered', function () {
$response = $this->get('/register');
$response->assertStatus(200);
});
test('new users can register', function () {
$response = Livewire::test(Register::class)
->set('name', 'Test User')
->set('email', 'test@example.com')
->set('password', 'password')
->set('password_confirmation', 'password')
->call('register');
$response
->assertHasNoErrors()
->assertRedirect(route('dashboard', absolute: false));
$this->assertAuthenticated();
});