Files
AFC-Demo/tests/Feature/Auth/RegistrationTest.php
T

24 lines
607 B
PHP
Raw Normal View History

2025-10-16 14:22:46 +02:00
<?php
use Livewire\Volt\Volt;
2025-10-16 14:22:58 +02:00
test('registration screen can be rendered', function () {
$response = $this->get(route('register'));
2025-10-16 14:22:46 +02:00
2025-10-16 14:22:58 +02:00
$response->assertStatus(200);
});
2025-10-16 14:22:46 +02:00
2025-10-16 14:22:58 +02:00
test('new users can register', function () {
$response = Volt::test('auth.register')
->set('name', 'Test User')
->set('email', 'test@example.com')
->set('password', 'password')
->set('password_confirmation', 'password')
->call('register');
2025-10-16 14:22:46 +02:00
2025-10-16 14:22:58 +02:00
$response
->assertHasNoErrors()
->assertRedirect(route('dashboard', absolute: false));
2025-10-16 14:22:46 +02:00
2025-10-16 14:22:58 +02:00
$this->assertAuthenticated();
});