Files
ppeasy_vg12/tests/Browser/DashboardTest.php
T
2026-10-09 08:21:06 +02:00

29 lines
745 B
PHP

<?php
use Facades\Tests\Setup\UserFactory;
beforeEach(function () {
$this->artisan('db:seed');
});
it('shows the user management widgets to an admin', function () {
browserLogin();
visit('/')
->assertNoJavaScriptErrors()
->assertSee('Dashboard')
->assertSee('Total Users')
->assertSee('New Users')
->assertSee('Registration History')
->assertSee('Latest Registrations');
});
it('hides the user management widgets from a role without the permission', function () {
browserLogin(UserFactory::user()->create(['password' => 'password']));
visit('/')
->assertSee('Dashboard')
->assertDontSee('Total Users')
->assertDontSee('Registration History');
});