feature: main page - code be
This commit is contained in:
@@ -37,4 +37,59 @@ class UserDashboardLayoutTest extends TestCase
|
||||
$response->assertSee('lg:min-w-[340px]', false);
|
||||
$response->assertSee('lg:max-w-[400px]', false);
|
||||
}
|
||||
|
||||
public function test_dashboard_renders_ranking_list_from_database(): void
|
||||
{
|
||||
$user1 = \App\Models\User::create([
|
||||
'msnv' => 5001,
|
||||
'name' => 'User A',
|
||||
'mail' => 'usera@runsystem.net',
|
||||
'pass' => md5('password'),
|
||||
'departments' => 1,
|
||||
'role' => \App\Models\User::ROLE_MEMBER,
|
||||
'status' => \App\Models\User::STATUS_ACTIVE,
|
||||
'card' => 10,
|
||||
'flag_send' => \App\Models\User::FLAG_SEND_ENABLED,
|
||||
'first_login' => \App\Models\User::FIRST_LOGIN_FALSE,
|
||||
]);
|
||||
|
||||
$user2 = \App\Models\User::create([
|
||||
'msnv' => 5002,
|
||||
'name' => 'User B',
|
||||
'mail' => 'userb@runsystem.net',
|
||||
'pass' => md5('password'),
|
||||
'departments' => 2,
|
||||
'role' => \App\Models\User::ROLE_MEMBER,
|
||||
'status' => \App\Models\User::STATUS_ACTIVE,
|
||||
'card' => 10,
|
||||
'flag_send' => \App\Models\User::FLAG_SEND_ENABLED,
|
||||
'first_login' => \App\Models\User::FIRST_LOGIN_FALSE,
|
||||
]);
|
||||
|
||||
\App\Models\Administration::create([
|
||||
'msnv' => 5002,
|
||||
'received' => 0,
|
||||
'sender' => null,
|
||||
'sent' => 5,
|
||||
'receiver' => 5001,
|
||||
'date' => \Carbon\Carbon::now()->format('Y-m-d')
|
||||
]);
|
||||
|
||||
\App\Models\Administration::create([
|
||||
'msnv' => 5001,
|
||||
'received' => 5,
|
||||
'sender' => 5002,
|
||||
'sent' => 0,
|
||||
'receiver' => null,
|
||||
'date' => \Carbon\Carbon::now()->format('Y-m-d')
|
||||
]);
|
||||
|
||||
$this->actingAs($user1);
|
||||
|
||||
$response = $this->get('/my-page');
|
||||
|
||||
$response->assertOk();
|
||||
$response->assertSee('User A', false);
|
||||
$response->assertSee('User B', false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user