feature: main page - always show current user at the bottom of ranking

This commit is contained in:
antv
2026-07-06 16:54:41 +07:00
parent e163d2f349
commit 1e050233b9
3 changed files with 92 additions and 52 deletions
+32
View File
@@ -209,4 +209,36 @@ class UserDashboardLayoutTest extends TestCase
$response->assertSee('Active User', false);
$response->assertDontSee('Inactive User', false);
}
public function test_dashboard_ranking_current_user_always_shown_at_bottom(): void
{
$user = \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,
]);
\App\Models\Administration::create([
'msnv' => 5001,
'received' => 10,
'sender' => 9999,
'sent' => 0,
'receiver' => null,
'date' => \Carbon\Carbon::now()->format('Y-m-d')
]);
$this->actingAs($user);
$response = $this->get('/my-page');
$response->assertOk();
$this->assertGreaterThan(1, substr_count($response->getContent(), 'User A'));
}
}