Files
PaperClipAI/server/src/__tests__
Priya RamanandPaperclip 3e92a4be31 test(server): cover reopen, scope, failure-closed, and the cleanup fence
Update the closed-workspace route tests: the resume, checkout, and comment
guards now reopen the workspace and continue instead of a 409 dead end. A
non-reopenable workspace returns 409 and a rebuild failure returns 503.

Add embedded-Postgres tests for the reopen service:
- a round trip reopens the archived row in place, keeps the issue link, and
  raises the lifecycle generation;
- two issues that share one workspace both keep access after a reopen;
- a failed rebuild keeps the row closed and retryable;
- a workspace in another company cannot be reopened;
- an already-active workspace reports success without a rebuild;
- the destruction fence runs the destroy when the generation matches and skips
  it after a reopen raised the generation.

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-08-13 01:23:40 +00:00
..

Server Tests

Server tests that need a real PostgreSQL process must use ./helpers/embedded-postgres.ts instead of constructing embedded-postgres directly.

The shared helper creates a throwaway data directory and a reserved-safe loopback port for each test database. This protects the live Paperclip control-plane Postgres from server vitest runs; see PAP-2033 for the incident that introduced this guard.