3.8 KiB
3.8 KiB
🧪 Settings System Testing Guide
✅ Setup Complete!
The settings system is now fully operational. Here's how to test it:
🔗 Access URLs
- Application: http://localhost:5174/
- Settings Page: http://localhost:5174/settings (Admin only)
🧪 Testing Steps
1. Login as Admin
URL: http://localhost:5174/login
Credentials: Use admin account (authLevel 2 or higher)
2. Access Settings Page
URL: http://localhost:5174/settings
Expected: Settings management interface with:
- Date format options (ar-SA / en-US)
- Currency selection (JOD, USD, EUR, SAR, AED)
- Number format options (ar-SA / en-US)
- Currency symbol input
- Real-time preview section
3. Test Date Format Changes
- Change date format from Arabic to English
- Click "حفظ الإعدادات" (Save Settings)
- Navigate to maintenance visits, vehicles, or customers
- Verify dates now show in English format (11/9/2025 vs ٩/١١/٢٠٢٥)
4. Test Currency Changes
- Change currency from JOD to USD
- Update currency symbol from "د.أ" to "$"
- Save settings
- Check maintenance visit costs and financial displays
- Verify format changes from "1,234.56 د.أ" to "1,234.56 $"
5. Test Number Format Changes
- Change number format from Arabic to English
- Save settings
- Check kilometer displays and numeric values
- Verify format changes from "١٬٢٣٤" to "1,234"
6. Test Real-time Preview
- Change any setting and observe the preview section
- Should show immediate formatting changes before saving
📍 Where to See Changes
Maintenance Visits (/maintenance-visits)
- Visit costs (currency formatting)
- Visit dates (date formatting)
- Kilometer readings (number formatting)
Vehicle Details (/vehicles)
- Last visit dates
- Creation/update dates
- Maintenance history costs
Customer Details (/customers)
- Customer creation dates
- Last update dates
- Associated vehicle information
🎯 Expected Behavior
Arabic Settings (ar-SA)
Date: ٩/١١/٢٠٢٥
Currency: ١٬٢٣٤٫٥٦ د.أ
Numbers: ١٬٢٣٤٫٥٦
Kilometers: ٤٥٬٠٠٠ كم
English Settings (en-US)
Date: 11/9/2025
Currency: 1,234.56 $
Numbers: 1,234.56
Kilometers: 45,000 كم
🔧 Admin Features
Settings Management
- ✅ Real-time preview of changes
- ✅ Form validation
- ✅ Reset to defaults button
- ✅ Success/error messages
- ✅ Admin-only access control
Supported Currencies
- JOD (د.أ) - Jordanian Dinar
- USD ($) - US Dollar
- EUR (€) - Euro
- SAR (ر.س) - Saudi Riyal
- AED (د.إ) - UAE Dirham
🚨 Troubleshooting
Settings Page Not Accessible
- Ensure you're logged in as admin (authLevel 2+)
- Check URL: http://localhost:5174/settings
Changes Not Appearing
- Refresh the page after saving settings
- Check browser console for errors
- Verify settings were saved (check preview section)
Formatting Not Applied
- Clear browser cache
- Restart development server
- Check that components use
useSettings()hook
✨ Success Indicators
When working correctly, you should see:
- Settings page loads without errors
- Preview updates in real-time as you change settings
- Save confirmation message appears after updating
- Formatting changes appear across all pages immediately
- Consistent formatting throughout the application
🎉 Features Verified
- ✅ Centralized settings management
- ✅ Real-time formatting preview
- ✅ Admin access control
- ✅ Database persistence
- ✅ Error handling and fallbacks
- ✅ Cross-component formatting consistency
- ✅ Arabic/English localization support
Status: Ready for Testing
Server: http://localhost:5174/
Settings: http://localhost:5174/settings