# Dashboard Navigation Tests

Tests for the dashboard and sidebar navigation in Open Core Business Suite.

## Test Environment
- Base URL: http://127.0.0.1:8000
- Dashboard: /dashboard
- Login Page: /auth/login

---

## Guest user redirect

**Prerequisite:** User is NOT logged in (fresh browser session, no cookies)

### Steps:
1. Clear all cookies and session data
2. Navigate directly to `/dashboard`

### Expected Results:
- User is redirected to `/auth/login`
- Login form is displayed
- No dashboard content is visible

---

## Admin dashboard access

**Prerequisite:** User is logged in as admin

### Steps:
1. Login as admin using seed test
2. Navigate to `/dashboard`
3. Wait for page to fully load

### Expected Results:
- Dashboard page loads successfully
- Dashboard widgets/cards are visible
- Statistics or summary data is displayed
- Sidebar menu is visible on the left
- User name "Admin" is visible in the top navigation
- No error messages are shown

---

## Sidebar navigation visibility

**Prerequisite:** User is logged in as admin

### Steps:
1. Login as admin
2. Navigate to dashboard
3. Observe the sidebar menu

### Expected Results:
- Sidebar is visible on the left side
- Menu items are clickable
- Common menu items are present:
  - Dashboard
  - Employees (if HRCore module enabled)
  - Settings (for admin users)
- Menu items have icons

---

## Navigate to Employees section

**Prerequisite:** User is logged in as admin, HRCore module is enabled

### Steps:
1. Login as admin
2. Navigate to dashboard
3. Locate "Employees" in the sidebar menu
4. Click on "Employees"

### Expected Results:
- Page navigates to employees list
- URL changes to include "employees" path
- Employee listing or DataTable is displayed
- Page title indicates "Employees"
- Breadcrumb shows current location

---

## Navigate back to Dashboard

**Prerequisite:** User is on a page other than dashboard

### Steps:
1. Login as admin
2. Navigate to Employees page
3. Click on "Dashboard" in the sidebar menu

### Expected Results:
- User is redirected to `/dashboard`
- Dashboard content is displayed
- Navigation is smooth without errors

---

## User profile dropdown

**Prerequisite:** User is logged in as admin

### Steps:
1. Login as admin
2. Navigate to dashboard
3. Locate the user profile area in the top navigation
4. Click on the user avatar/name dropdown

### Expected Results:
- Dropdown menu appears
- Options include:
  - Profile or My Account
  - Logout
- Menu items are clickable

---

## Responsive sidebar toggle (mobile view)

**Prerequisite:** User is logged in, viewport is mobile-sized

### Steps:
1. Login as admin
2. Resize browser window to mobile width (< 768px)
3. Locate the hamburger menu icon
4. Click the hamburger icon

### Expected Results:
- Sidebar slides in from the left (or toggles visibility)
- Menu items are accessible
- Clicking outside closes the sidebar
- Navigation works correctly on mobile

---

## Quick create menu (if available)

**Prerequisite:** User is logged in as admin

### Steps:
1. Login as admin
2. Navigate to dashboard
3. Locate the "Quick Create" or "+" button
4. Click to expand options

### Expected Results:
- Quick create menu expands
- Options for creating new items are visible
- Clicking an option navigates to the appropriate creation form
