docs: update testing guide and sidebar documentation
- Add Testing Hub (Admin Dashboard) section to testing guide - Document features: collection, running tests, statistics - Document API endpoints and background execution - Update sidebar documentation for new structure: - Add Product Catalog section - Add Platform Health section (Testing Hub, Code Quality, Background Tasks) - Update Settings to collapsible section - Update page-to-section mappings 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -15,11 +15,13 @@ The sidebar is organized into the following sections:
|
|||||||
| Section | Collapsible | Pages |
|
| Section | Collapsible | Pages |
|
||||||
|---------|-------------|-------|
|
|---------|-------------|-------|
|
||||||
| Dashboard | No | Dashboard |
|
| Dashboard | No | Dashboard |
|
||||||
| Platform Administration | Yes | Companies, Vendors, Users, Customers, Marketplace |
|
| Platform Administration | Yes | Companies, Vendors, Users, Customers |
|
||||||
|
| Product Catalog | Yes | Marketplace Products, Vendor Products, Import |
|
||||||
| Content Management | Yes | Platform Homepage, Content Pages, Vendor Themes |
|
| Content Management | Yes | Platform Homepage, Content Pages, Vendor Themes |
|
||||||
| Developer Tools | Yes | Components, Icons, Testing Hub, Code Quality |
|
| Developer Tools | Yes | Components, Icons |
|
||||||
|
| Platform Health | Yes | Testing Hub, Code Quality, Background Tasks |
|
||||||
| Platform Monitoring | Yes | Import Jobs, Application Logs |
|
| Platform Monitoring | Yes | Import Jobs, Application Logs |
|
||||||
| Settings | No | Settings |
|
| Settings | Yes | General, Profile, API Keys, Notifications |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -37,9 +39,12 @@ Sections can be expanded/collapsed by clicking the section header. The state is
|
|||||||
// Default state: Platform Administration open, others closed
|
// Default state: Platform Administration open, others closed
|
||||||
const defaultSections = {
|
const defaultSections = {
|
||||||
platformAdmin: true,
|
platformAdmin: true,
|
||||||
|
productCatalog: false,
|
||||||
contentMgmt: false,
|
contentMgmt: false,
|
||||||
devTools: false,
|
devTools: false,
|
||||||
monitoring: false
|
platformHealth: false,
|
||||||
|
monitoring: false,
|
||||||
|
settingsSection: false
|
||||||
};
|
};
|
||||||
|
|
||||||
// State stored in localStorage under this key
|
// State stored in localStorage under this key
|
||||||
@@ -53,9 +58,12 @@ const SIDEBAR_STORAGE_KEY = 'admin_sidebar_sections';
|
|||||||
| `toggleSection(section)` | Toggle a section open/closed |
|
| `toggleSection(section)` | Toggle a section open/closed |
|
||||||
| `expandSectionForCurrentPage()` | Auto-expand section containing current page |
|
| `expandSectionForCurrentPage()` | Auto-expand section containing current page |
|
||||||
| `openSections.platformAdmin` | Check if Platform Administration is open |
|
| `openSections.platformAdmin` | Check if Platform Administration is open |
|
||||||
|
| `openSections.productCatalog` | Check if Product Catalog is open |
|
||||||
| `openSections.contentMgmt` | Check if Content Management is open |
|
| `openSections.contentMgmt` | Check if Content Management is open |
|
||||||
| `openSections.devTools` | Check if Developer Tools is open |
|
| `openSections.devTools` | Check if Developer Tools is open |
|
||||||
|
| `openSections.platformHealth` | Check if Platform Health is open |
|
||||||
| `openSections.monitoring` | Check if Platform Monitoring is open |
|
| `openSections.monitoring` | Check if Platform Monitoring is open |
|
||||||
|
| `openSections.settingsSection` | Check if Settings is open |
|
||||||
|
|
||||||
### CSS Transitions
|
### CSS Transitions
|
||||||
|
|
||||||
@@ -98,7 +106,10 @@ const pageSectionMap = {
|
|||||||
vendors: 'platformAdmin',
|
vendors: 'platformAdmin',
|
||||||
users: 'platformAdmin',
|
users: 'platformAdmin',
|
||||||
customers: 'platformAdmin',
|
customers: 'platformAdmin',
|
||||||
marketplace: 'platformAdmin',
|
// Product Catalog
|
||||||
|
'marketplace-products': 'productCatalog',
|
||||||
|
'vendor-products': 'productCatalog',
|
||||||
|
marketplace: 'productCatalog',
|
||||||
// Content Management
|
// Content Management
|
||||||
'platform-homepage': 'contentMgmt',
|
'platform-homepage': 'contentMgmt',
|
||||||
'content-pages': 'contentMgmt',
|
'content-pages': 'contentMgmt',
|
||||||
@@ -106,11 +117,18 @@ const pageSectionMap = {
|
|||||||
// Developer Tools
|
// Developer Tools
|
||||||
components: 'devTools',
|
components: 'devTools',
|
||||||
icons: 'devTools',
|
icons: 'devTools',
|
||||||
testing: 'devTools',
|
// Platform Health
|
||||||
'code-quality': 'devTools',
|
testing: 'platformHealth',
|
||||||
|
'code-quality': 'platformHealth',
|
||||||
|
'background-tasks': 'platformHealth',
|
||||||
// Platform Monitoring
|
// Platform Monitoring
|
||||||
imports: 'monitoring',
|
imports: 'monitoring',
|
||||||
logs: 'monitoring'
|
logs: 'monitoring',
|
||||||
|
// Settings
|
||||||
|
settings: 'settingsSection',
|
||||||
|
profile: 'settingsSection',
|
||||||
|
'api-keys': 'settingsSection',
|
||||||
|
'notifications-settings': 'settingsSection'
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -125,17 +143,23 @@ const pageSectionMap = {
|
|||||||
| Vendors | `'vendors'` | Platform Administration | `/admin/vendors` |
|
| Vendors | `'vendors'` | Platform Administration | `/admin/vendors` |
|
||||||
| Users | `'users'` | Platform Administration | `/admin/users` |
|
| Users | `'users'` | Platform Administration | `/admin/users` |
|
||||||
| Customers | `'customers'` | Platform Administration | `/admin/customers` |
|
| Customers | `'customers'` | Platform Administration | `/admin/customers` |
|
||||||
| Marketplace | `'marketplace'` | Platform Administration | `/admin/marketplace` |
|
| Marketplace Products | `'marketplace-products'` | Product Catalog | `/admin/marketplace-products` |
|
||||||
|
| Vendor Products | `'vendor-products'` | Product Catalog | `/admin/vendor-products` |
|
||||||
|
| Import | `'marketplace'` | Product Catalog | `/admin/marketplace` |
|
||||||
| Platform Homepage | `'platform-homepage'` | Content Management | `/admin/platform-homepage` |
|
| Platform Homepage | `'platform-homepage'` | Content Management | `/admin/platform-homepage` |
|
||||||
| Content Pages | `'content-pages'` | Content Management | `/admin/content-pages` |
|
| Content Pages | `'content-pages'` | Content Management | `/admin/content-pages` |
|
||||||
| Vendor Themes | `'vendor-theme'` | Content Management | `/admin/vendor-themes` |
|
| Vendor Themes | `'vendor-theme'` | Content Management | `/admin/vendor-themes` |
|
||||||
| Components | `'components'` | Developer Tools | `/admin/components` |
|
| Components | `'components'` | Developer Tools | `/admin/components` |
|
||||||
| Icons | `'icons'` | Developer Tools | `/admin/icons` |
|
| Icons | `'icons'` | Developer Tools | `/admin/icons` |
|
||||||
| Testing Hub | `'testing'` | Developer Tools | `/admin/testing` |
|
| Testing Hub | `'testing'` | Platform Health | `/admin/testing` |
|
||||||
| Code Quality | `'code-quality'` | Developer Tools | `/admin/code-quality` |
|
| Code Quality | `'code-quality'` | Platform Health | `/admin/code-quality` |
|
||||||
|
| Background Tasks | `'background-tasks'` | Platform Health | `/admin/background-tasks` |
|
||||||
| Import Jobs | `'imports'` | Platform Monitoring | `/admin/imports` |
|
| Import Jobs | `'imports'` | Platform Monitoring | `/admin/imports` |
|
||||||
| Application Logs | `'logs'` | Platform Monitoring | `/admin/logs` |
|
| Application Logs | `'logs'` | Platform Monitoring | `/admin/logs` |
|
||||||
| Settings | `'settings'` | (always visible) | `/admin/settings` |
|
| General Settings | `'settings'` | Settings | `/admin/settings` |
|
||||||
|
| Profile | `'profile'` | Settings | `/admin/profile` |
|
||||||
|
| API Keys | `'api-keys'` | Settings | `/admin/api-keys` |
|
||||||
|
| Notifications | `'notifications-settings'` | Settings | `/admin/notifications-settings` |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ The Wizamart platform employs a comprehensive testing strategy with four distinc
|
|||||||
- [Mocking](#mocking)
|
- [Mocking](#mocking)
|
||||||
- [Best Practices](#best-practices)
|
- [Best Practices](#best-practices)
|
||||||
- [Troubleshooting](#troubleshooting)
|
- [Troubleshooting](#troubleshooting)
|
||||||
|
- [Testing Hub (Admin Dashboard)](#testing-hub-admin-dashboard)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -1266,6 +1267,71 @@ If you encounter issues:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## Testing Hub (Admin Dashboard)
|
||||||
|
|
||||||
|
The platform includes a web-based Testing Hub accessible at `/admin/testing` that provides a visual interface for running tests and monitoring test health.
|
||||||
|
|
||||||
|
### Accessing the Testing Hub
|
||||||
|
|
||||||
|
Navigate to **Platform Health → Testing Hub** in the admin sidebar, or go directly to `/admin/testing`.
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
#### 1. Test Collection
|
||||||
|
Click **Collect Tests** to discover all available tests in the codebase without running them. This displays:
|
||||||
|
|
||||||
|
- **Total Tests**: Number of test functions discovered
|
||||||
|
- **Unit Tests**: Tests in `tests/unit/`
|
||||||
|
- **Integration Tests**: Tests in `tests/integration/`
|
||||||
|
- **Performance Tests**: Tests in `tests/performance/`
|
||||||
|
- **Test Files**: Number of test files
|
||||||
|
|
||||||
|
#### 2. Running Tests
|
||||||
|
Click **Run Tests** to execute the test suite. Tests run in the background, so you can:
|
||||||
|
- Leave the page and return later
|
||||||
|
- Monitor elapsed time in real-time
|
||||||
|
- See results when tests complete
|
||||||
|
|
||||||
|
#### 3. Dashboard Statistics
|
||||||
|
The dashboard shows results from the last test run:
|
||||||
|
|
||||||
|
- **Pass Rate**: Percentage of tests passing
|
||||||
|
- **Passed/Failed/Errors**: Test outcome counts
|
||||||
|
- **Duration**: How long the test run took
|
||||||
|
- **Skipped**: Tests marked to skip
|
||||||
|
|
||||||
|
#### 4. Trend Analysis
|
||||||
|
View pass rate trends across the last 10 test runs to identify regressions.
|
||||||
|
|
||||||
|
#### 5. Tests by Category
|
||||||
|
See breakdown of passed/failed tests by category (Unit, Integration, etc.).
|
||||||
|
|
||||||
|
#### 6. Top Failing Tests
|
||||||
|
Quickly identify tests that fail most frequently across runs.
|
||||||
|
|
||||||
|
### API Endpoints
|
||||||
|
|
||||||
|
The Testing Hub uses these API endpoints:
|
||||||
|
|
||||||
|
| Endpoint | Method | Description |
|
||||||
|
|----------|--------|-------------|
|
||||||
|
| `/api/v1/admin/tests/stats` | GET | Dashboard statistics |
|
||||||
|
| `/api/v1/admin/tests/run` | POST | Start a test run |
|
||||||
|
| `/api/v1/admin/tests/runs` | GET | List recent test runs |
|
||||||
|
| `/api/v1/admin/tests/runs/{id}` | GET | Get specific run details |
|
||||||
|
| `/api/v1/admin/tests/collect` | POST | Collect test information |
|
||||||
|
|
||||||
|
### Background Execution
|
||||||
|
|
||||||
|
Test runs execute as background tasks, allowing:
|
||||||
|
- Non-blocking UI during long test runs
|
||||||
|
- Ability to navigate away and return
|
||||||
|
- Automatic status polling every 2 seconds
|
||||||
|
|
||||||
|
View all background tasks including test runs at **Platform Health → Background Tasks**.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Summary
|
## Summary
|
||||||
|
|
||||||
This testing guide covers:
|
This testing guide covers:
|
||||||
@@ -1277,5 +1343,6 @@ This testing guide covers:
|
|||||||
- ✅ Mocking patterns and best practices
|
- ✅ Mocking patterns and best practices
|
||||||
- ✅ Best practices for maintainable tests
|
- ✅ Best practices for maintainable tests
|
||||||
- ✅ Troubleshooting common issues
|
- ✅ Troubleshooting common issues
|
||||||
|
- ✅ Testing Hub admin dashboard
|
||||||
|
|
||||||
For information about maintaining and extending the test suite, see [Test Maintenance Guide](test-maintenance.md).
|
For information about maintaining and extending the test suite, see [Test Maintenance Guide](test-maintenance.md).
|
||||||
|
|||||||
Reference in New Issue
Block a user