Filament Test

Good evening, can anyone help with filament test using pest. I wanted to test the dashboard panel login. For examples can't be accessed by guest and redirect it to the login page.
1 Reply
tuto1902
tuto19028mo ago
When using the panel builder, you don't really need to test this feature. These are all well tested features by the Filament team and there's no real need to test them by yourself. But if you want to test it still, I think this should be enough
use Filament\Pages;

it('redirects to login', function () {
get(Pages\Dashboard::getUrl())
->assertRedirect('/admin/login');
});
use Filament\Pages;

it('redirects to login', function () {
get(Pages\Dashboard::getUrl())
->assertRedirect('/admin/login');
});