Test Objective
The purpose of testing was to confirm that the system performs the main staffing workflows correctly, protects manager-only operations, preserves database consistency, and produces understandable results in the browser. The test plan is connected to the functional requirements and business rules rather than checking pages only by appearance.
Test Levels
Unit tests cover rules that can be checked without a live database. These include quarter-hour rounding, Monday-based week calculation, overtime separation, and the permitted clock-in window.
API and workflow cases cover authentication, role restrictions, employees, certifications, scheduling, requests, swaps, attendance, reports, and notifications. Browser verification confirms that the client can sign in and load each main manager page using the seeded PostgreSQL data.
Production build verification checks TypeScript across the server and client and confirms that Next.js can generate all static and dynamic routes.
Main Test Cases
Authentication tests check valid sign-in, rejection of unauthenticated requests, and rejection of employee access to manager routes. Employee tests cover creating, finding, updating, and deactivating a record while keeping history.
Schedule tests cover shift creation, direct assignment, overlap rejection, insufficient-rest rejection, qualification shortages, staffing warnings, and controlled publication. Request tests cover time-off decisions, open-shift responses, and the three-stage swap workflow.
Attendance tests check the thirty-minute clock-in window, clock-out order, correction reasons, quarter-hour rounding, weekly totals, and overtime. Reporting tests check date filtering, staffing counts, certification gaps, regular hours, and overtime columns.
Executed Automated Results
I ran the complete automated suite with:
“`text
npm test
“`
Vitest reported three test files and eight tests passed with no failures:
– Server: two test files, six tests passed.
– Client: one test file, two tests passed.
– Total: three test files, eight tests passed.
The executed checks include rounding 487 minutes to 495 minutes, finding the Monday that begins a reporting week, separating 46 hours into 40 regular and 6 overtime hours, and checking the clock-in window before and during a shift.
I also ran:
“`text
npm run build
“`
The Express TypeScript build completed successfully. The Next.js production build compiled successfully, completed TypeScript checking, generated its static pages, listed the application routes, and finished page optimization without an error.
Database and Browser Verification
Prisma Client generation, database migration, and seed loading completed successfully. The API health endpoint returned an `ok` result. Browser verification confirmed the following pages against the local PostgreSQL database:
– Login
– Dashboard
– Employees
– Schedules
– Requests
– Open shifts and swaps
– Attendance
– Reports
– Notifications
Screenshots of these pages are stored in `docs/evidence`. The employee list displayed thirty seeded employees, the schedule page displayed draft and published periods, attendance displayed completed records and weekly totals, and the coverage report displayed staffing and qualification results.
Result and Remaining Testing
The automated tests, production build, database setup, API health check, and main browser pages all passed. No test failure remained at final verification.
Before a real deployment, the organization should still perform user acceptance testing with its actual staffing policies, security review, backup and restore testing, load testing with production-sized history, and testing of an approved external email provider. These activities require the production environment and are outside the local course demonstration.