test(integration): dockerized webmail⇆Stalwart Playwright sync suite
Add an end-to-end integration harness that runs the webmail against a real Stalwart mail server in Docker and drives it with Playwright, focused on the mail/folder synchronisation behaviour (unread/total counters, folder-list sync, account-scoped Unified Mailbox) that the unified-mailbox work touches. - integration/ stack: Stalwart (declarative bootstrap: alice/bob/carol, submission + IMAP listeners, permissive CORS) + webmail (dev mode, so the browser's plaintext cross-origin JMAP calls aren't blocked by the prod CSP). - Helpers: dependency-free SMTP submit client, JMAP client for seeding / inspecting server state, and page helpers (login, add/switch account, locale-independent folder-counter reads). - Specs: login, single-account sync (receive/read/move/delete/folder-create/ burst) and multi-account (per-account isolation + cross-account Unified Inbox aggregation + background-account delivery). 12 tests, all green. - Add focused data-testid hooks to the mail UI (folder rows + counters, email list items, account switcher, composer) for stable selectors. - Exclude examples/ and integration/ from tsconfig/eslint/.dockerignore.
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
# Webmail image for integration testing — runs Next.js in DEVELOPMENT mode.
|
||||
#
|
||||
# Why dev mode rather than the production Dockerfile at the repo root?
|
||||
# The browser talks JMAP directly to Stalwart at http://localhost:8025 (plain
|
||||
# HTTP, cross-origin). The app's production Content-Security-Policy pins
|
||||
# connect-src to `'self' https:`, which would block that plaintext cross-origin
|
||||
# fetch. In development mode proxy.ts widens connect-src to `'self' http:
|
||||
# https: ws: wss:` — exactly what a local, TLS-less Stalwart needs. Running
|
||||
# from source also ships the integration-test data-testid hooks without a
|
||||
# production rebuild.
|
||||
#
|
||||
# Build context is the repo root (see docker-compose.yml `context: ..`), so the
|
||||
# root .dockerignore keeps examples/, integration/ and node_modules out.
|
||||
|
||||
FROM node:24-alpine
|
||||
WORKDIR /app
|
||||
|
||||
# Install dependencies first for layer caching.
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci
|
||||
|
||||
# App source (data-testid hooks included).
|
||||
COPY . .
|
||||
|
||||
ENV NODE_ENV=development
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
ENV PORT=3000
|
||||
ENV HOSTNAME=0.0.0.0
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
# Bind to 0.0.0.0 so the published port is reachable from the host/browser.
|
||||
CMD ["npx", "next", "dev", "-H", "0.0.0.0", "-p", "3000"]
|
||||
Reference in New Issue
Block a user