- Add timezone configuration per space with fallback to system default - Implement timezone-aware datetime display and editing across frontend - Add migration for per_space_settings table - Update booking service to handle timezone conversions properly - Improve .gitignore to exclude build artifacts - Add comprehensive testing documentation Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
6.5 KiB
Testing Guide - Spaces & Dashboard Implementation
Application Status
✅ Backend: Running on http://localhost:8000 ✅ Frontend: Running on http://localhost:5174 ✅ API Tests: All endpoints working correctly
Test Data
Users
- Admin: admin@example.com / adminpassword
- User: user@example.com / userpassword
Spaces
- Biblioteca Colorata 1 (sala, capacity: 20) - Active
- Biblioteca Colorata 2 (sala, capacity: 20) - Active
Bookings
- Test Meeting - Tomorrow at 10:00 (Pending approval)
Manual Testing Steps
1. Test Dashboard Page (/)
As Admin User:
- Open http://localhost:5174 in your browser
- Login with: admin@example.com / adminpassword
- You should see the Dashboard with:
-
✅ Quick Stats Cards:
- Total Bookings: 1
- Pending: 1
- Approved: 0
- Pending Requests: 1 (admin only)
-
✅ Quick Actions Section:
- "Book a Space" button → links to /spaces
- "My Bookings" button → links to /my-bookings
- "Manage Bookings" button (admin only) → links to /admin/bookings
- "Manage Spaces" button (admin only) → links to /admin/spaces
-
✅ Upcoming Bookings Card:
- Shows "Test Meeting" for tomorrow at 10:00
- Displays space name "Biblioteca Colorata 1"
- Shows status badge "Pending"
- Has "View All" link to /my-bookings
-
✅ Available Spaces Card:
- Shows 2 active spaces
- Each space clickable → navigates to /spaces/:id
- Displays type and capacity
- Has "View All" link to /spaces
-
✅ Recent Activity Card (admin only):
- Shows last 3-5 audit log entries
- Displays action, user, and timestamp
- Has "View All" link to /admin/audit-log
-
Expected Behavior:
- Loading spinner appears briefly while fetching data
- All cards display correctly with accurate data
- Links navigate to correct pages
- Admin-only sections visible only to admin users
2. Test Spaces Page (/spaces)
- Navigate to http://localhost:5174/spaces (or click "Book a Space" from Dashboard)
- You should see:
-
✅ Page Header:
- Title: "Available Spaces"
- Subtitle: "Browse and reserve meeting rooms and desk spaces"
-
✅ Filters:
- Type dropdown: All Types / Desk / Meeting Room / Conference Room
- Status dropdown: All / Active Only
-
✅ Spaces Grid:
- 2 space cards displayed in responsive grid
- Each card shows:
- Space name (e.g., "Biblioteca Colorata 1")
- Active/Inactive badge
- Type icon and label
- Capacity icon and count
- Description (truncated to 100 chars)
- "View Details" button
-
✅ Card Interactions:
- Hover effect: card lifts up with shadow
- Click anywhere on card → navigates to /spaces/:id (detail page)
-
Test Filtering:
- Change Type filter → cards update (currently all are "sala", so mapping may show as is)
- Change Status to "Active Only" → shows only active spaces (both visible)
- Empty filters → should show "No Spaces Found" message
Expected Behavior:
- Loading spinner while fetching spaces
- Cards render in a responsive grid (3 columns on desktop, 1 on mobile)
- Clicking a card navigates to SpaceDetail page with calendar
- Empty state shows when no spaces match filters
3. Test Space Detail Page (/spaces/:id)
- From Spaces page, click on any space card
- You should see:
- ✅ Breadcrumbs: Home / Spaces / [Space Name]
- ✅ Space header with name, badges (type, capacity, status)
- ✅ Reserve Space button (already implemented)
- ✅ Description card (if space has description)
- ✅ Availability Calendar (already implemented)
Expected Behavior:
- Page loads space details correctly
- Calendar shows existing bookings
- Reserve button is functional
4. Test as Regular User
-
Logout (if logged in as admin)
-
Login with: user@example.com / userpassword
-
Dashboard should show:
- ✅ Quick stats (Total, Pending, Approved) - WITHOUT "Pending Requests" card
- ✅ Quick actions - WITHOUT "Manage Bookings" and "Manage Spaces" buttons
- ✅ Upcoming Bookings - empty or only user's bookings
- ✅ Available Spaces - same 2 spaces
- ✅ NO "Recent Activity" section
-
Spaces page should work identically for regular users
Expected Behavior:
- Admin-specific features hidden for regular users
- All other functionality works the same
Automated Test Results
✅ All API endpoints tested successfully
✅ Spaces page: Can display 2 spaces with filtering
✅ Dashboard stats: Total: 1, Pending: 1, Approved: 0
✅ Upcoming bookings: 1 upcoming bookings
✅ Available spaces: 2 active spaces
✅ Admin features: 1 pending requests, 3 recent logs
✅ ESLint: No errors
Verification Checklist
Spaces.vue
- Grid layout with space cards
- Filtering by type and status
- Loading state spinner
- Empty state message
- Error handling
- Click navigation to detail page
- Responsive design
- Displays: name, type, capacity, status, description
Dashboard.vue
- Quick stats cards (total, pending, approved)
- Admin stats (pending requests)
- Quick actions with links
- Upcoming bookings list (sorted by date)
- Available spaces list
- Admin recent activity logs
- Loading state
- Empty states for each section
- Responsive design
- Role-based visibility (admin vs user)
Code Quality
- TypeScript types correct
- ESLint passing
- Uses existing APIs
- Consistent styling with SpaceDetail.vue
- Error handling implemented
Known Limitations
-
Type mapping: Backend uses "sala" type, frontend expects "desk/meeting_room/conference_room"
- Current workaround: formatType() function handles both
- Consider aligning backend types with frontend expectations
-
Empty bookings: Test data has only 1 booking
- To test full functionality, create more bookings via UI or API
-
Time zones: Dates displayed in UTC
- Future enhancement: format according to user's timezone
Next Steps
- ✅ Spaces.vue - IMPLEMENTED
- ✅ Dashboard.vue - IMPLEMENTED
- 🔜 Booking creation flow (US-004d)
- 🔜 My Bookings page
- 🔜 Admin booking management
Support
If you encounter issues:
- Check browser console for errors (F12)
- Verify backend is running:
curl http://localhost:8000/health - Verify frontend is running:
curl http://localhost:5174/ - Check API responses: http://localhost:8000/docs