Skip to content

Latest commit

 

History

History
222 lines (163 loc) · 4.48 KB

File metadata and controls

222 lines (163 loc) · 4.48 KB

Testing DeskFlow

Quick Start

cp .env.example .env
npm install
docker compose up -d
npm run prisma:migrate
npm run prisma:seed
npm run dev

Open:

Frontend: http://localhost:5173
API:      http://localhost:4000

If Vite says Port 5173 is in use, open the printed URL, usually http://localhost:5174.

Demo accounts:

user@deskflow.dev / demo1234
support@deskflow.dev / demo1234
admin@deskflow.dev / demo1234

If Docker is not installed, start any PostgreSQL 16 instance manually and set DATABASE_URL in .env.

Arch Linux Docker Setup

On Arch, install Docker and Docker Compose, then start the Docker service:

sudo pacman -Syu
sudo pacman -S docker docker-compose
sudo systemctl enable --now docker
sudo usermod -aG docker "$USER"
newgrp docker

Check Compose:

docker compose version

If docker compose is not available but docker-compose is available, use:

docker-compose up -d

instead of:

docker compose up -d

Automated Checks

npm run typecheck
npm test
npm run build
npm run check

Expected result:

typecheck: no TypeScript errors
test: all Vitest tests passed
build: server and client production build completed
check: typecheck + tests passed

Manual Functional Checklist

1. Auth

  • Open /login.
  • Click each demo account button and verify credentials are filled.
  • Login as USER, SUPPORT and ADMIN.
  • Logout returns to login.
  • Register creates a new USER account.

2. USER Flow

  • Login as user@deskflow.dev.
  • Open /my/tickets.
  • Verify only this user's tickets are visible.
  • Search tickets by title text.
  • Filter by status and priority.
  • Sort newest, oldest, priority and SLA.
  • Open /my/tickets/new.
  • Create a ticket with title, description, category and priority.
  • Open created ticket detail.
  • Add a public comment.
  • Delete your own public comment.
  • Upload allowed file type: png, jpg, jpeg, pdf or txt, max 5MB.
  • Close the ticket.
  • Delete your own ticket.
  • Verify USER does not see internal comments or activity log.

3. SUPPORT Flow

  • Login as support@deskflow.dev.
  • Open /support/dashboard.
  • Verify metric cards and grouped charts are visible.
  • Open /support/tickets.
  • Verify all tickets are visible, not only own tickets.
  • Search, filter and sort the queue.
  • Open a ticket detail.
  • Click Assign to me.
  • Change status to IN_PROGRESS, PENDING, RESOLVED.
  • Change priority.
  • Add a public comment.
  • Add an internal note.
  • Delete any public or internal comment.
  • Delete any ticket from the ticket detail page.
  • Verify activity log records actions.
  • Verify SLA badge changes between On track, At risk, Overdue and Resolved based on ticket state.

4. ADMIN Flow

  • Login as admin@deskflow.dev.
  • Open /admin/users.
  • Change a user's role.
  • Block and activate a user.
  • Open /admin/categories.
  • Create a category.
  • Disable and enable a category.
  • Open /admin/audit.
  • Verify activity logs are visible.

5. Access Control

  • As USER, try opening a support route like /support/dashboard; it should redirect away.
  • As SUPPORT, try opening /admin/users; it should redirect away.
  • As USER, open own ticket detail and verify internal notes are hidden.
  • As SUPPORT or ADMIN, open the same ticket and verify internal notes are visible.

6. API Smoke Tests

Login:

curl -s http://localhost:4000/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email":"support@deskflow.dev","password":"demo1234"}'

Use returned token:

TOKEN="paste-token-here"

curl -s http://localhost:4000/api/auth/me \
  -H "Authorization: Bearer $TOKEN"

curl -s http://localhost:4000/api/tickets \
  -H "Authorization: Bearer $TOKEN"

curl -s http://localhost:4000/api/support/dashboard \
  -H "Authorization: Bearer $TOKEN"

curl -s http://localhost:4000/api/health

Reset Local Data

npm run prisma:migrate
npm run prisma:seed

For a full Docker database reset:

docker compose down -v
docker compose up -d
npm run prisma:migrate
npm run prisma:seed

Common Issues

docker: command not found

Install Docker Desktop or run PostgreSQL manually and update .env.

Prisma cannot connect

Check that PostgreSQL is running:

docker compose ps

Then verify DATABASE_URL matches .env.example.

Login works but pages are empty

Run seed:

npm run prisma:seed

Upload fails

Only these MIME types are accepted:

png, jpg, jpeg, pdf, txt

Max file size is 5MB.