feature: main page

This commit is contained in:
antv
2026-07-06 14:37:32 +07:00
parent b1beed4ae6
commit 11a6568717
3 changed files with 100 additions and 2 deletions
+2 -2
View File
@@ -49,7 +49,7 @@
</x-stat-card>
</div>
<div class="flex flex-col gap-6 lg:flex-row lg:items-start lg:gap-8">
<div class="flex flex-col gap-6 xl:flex-row xl:items-start xl:gap-8">
<div class="flex-1 min-w-0 flex flex-col gap-6">
@@ -94,7 +94,7 @@
</div>
</div>
<div class="w-full lg:w-[380px] lg:flex-shrink-0 flex flex-col gap-6">
<div class="w-full xl:w-[380px] xl:flex-shrink-0 flex flex-col gap-6">
<div class="bg-white rounded-[24px] shadow-[0_10px_30px_rgba(15,23,42,0.05)] p-6 flex flex-col h-full">
<div class="flex items-center justify-between mb-3 pl-1 pr-1">
+67
View File
@@ -0,0 +1,67 @@
<?php
namespace Tests\Feature;
use App\Models\User;
use App\Services\Admin\Contracts\AdminServiceInterface;
use App\Services\User\Contracts\UserServiceInterface;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class PasswordMd5Test extends TestCase
{
use RefreshDatabase;
private UserServiceInterface $userService;
private AdminServiceInterface $adminService;
protected function setUp(): void
{
parent::setUp();
$this->userService = $this->app->make(UserServiceInterface::class);
$this->adminService = $this->app->make(AdminServiceInterface::class);
}
public function test_user_service_update_password_stores_as_md5(): void
{
$user = User::create([
'msnv' => 4001,
'name' => 'Test User',
'mail' => 'test@example.com',
'pass' => md5('old_password'),
'departments' => 1,
'role' => User::ROLE_MEMBER,
'status' => User::STATUS_ACTIVE,
'card' => 10,
'flag_send' => User::FLAG_SEND_ENABLED,
'first_login' => User::FIRST_LOGIN_TRUE,
]);
$this->userService->updatePassword($user, 'new_secret_password');
$user->refresh();
$this->assertEquals(md5('new_secret_password'), $user->pass);
$this->assertEquals(User::FIRST_LOGIN_FALSE, $user->first_login);
}
public function test_admin_service_create_user_stores_password_as_md5(): void
{
$data = [
'msnv' => 4002,
'name' => 'Created User',
'mail' => 'created@example.com',
'departments' => 2,
'password' => 'admin_created_pass',
'role' => User::ROLE_MEMBER,
];
$this->adminService->createUser($data);
$user = User::where('msnv', 4002)->first();
$this->assertNotNull($user);
$this->assertEquals(md5('admin_created_pass'), $user->pass);
$this->assertEquals(User::FIRST_LOGIN_TRUE, $user->first_login);
}
}
+31
View File
@@ -0,0 +1,31 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class UserDashboardLayoutTest extends TestCase
{
use RefreshDatabase;
public function test_dashboard_renders_two_column_layout_for_desktop(): void
{
$user = \App\Models\User::factory()->create([
'email' => 'admin@runsystem.net',
'name' => 'System Admin',
]);
$this->actingAs($user);
$response = $this->get('/my-page');
$response->assertOk();
$response->assertSee('Thanks gần đây', false);
$response->assertSee('Bảng xếp hạng', false);
$response->assertSee('xl:flex-row', false);
$response->assertSee('xl:w-[380px]', false);
$response->assertSee('xl:flex-shrink-0', false);
$response->assertSee('flex-1 min-w-0', false);
}
}