Tests for auth refresh, ad viewability and URL safety; nginx, Dockerfile, README

- Jest: single-flight refresh, session expiry vs transient errors, token save on login change,
  logout revoke, IAB viewability, safe URLs, HTML escaping, password policy, ad session id
- test:ci with explicit testMatch (dot-directories in worktree paths hid all tests)
- nginx: gzip, nosniff/Referrer-Policy/X-Frame-Options, no-cache for index.html
- Dockerfile: npm ci, REACT_APP_WS_ERROR_QUEUE build arg
- README: new backend contracts, flags, compatibility notes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
SlimusMinus
2026-10-20 11:56:39 +03:00
parent 804018d2ce
commit a029254cf0
10 changed files with 485 additions and 26 deletions

View File

@@ -1,7 +1,8 @@
FROM node:22-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm install --legacy-peer-deps
COPY package*.json .npmrc ./
# npm ci — ровно версии из package-lock.json (legacy-peer-deps берётся из .npmrc)
RUN npm ci
COPY . .
ARG REACT_APP_API_URL=https://app.nahodka-test.online
ARG REACT_APP_YANDEX_GEOCODER_KEY=
@@ -11,6 +12,9 @@ ENV REACT_APP_API_URL=$REACT_APP_API_URL
ENV REACT_APP_YANDEX_GEOCODER_KEY=$REACT_APP_YANDEX_GEOCODER_KEY
ENV REACT_APP_YANDEX_MAPS_KEY=$REACT_APP_YANDEX_MAPS_KEY
ENV REACT_APP_YANDEX_SUGGEST_KEY=$REACT_APP_YANDEX_SUGGEST_KEY
# true — после деплоя бэкенда, принимающего подписку /user/queue/errors
ARG REACT_APP_WS_ERROR_QUEUE=false
ENV REACT_APP_WS_ERROR_QUEUE=$REACT_APP_WS_ERROR_QUEUE
RUN npm run build
FROM nginx:alpine