Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ npm run test:integration:automation
```

Browser tests use explicit fixtures and do not call a paid model. The optional
`tests/integration/real-backend.mjs` path runs the real FastAPI service against
the loopback provider in `tests/fixtures/llm-stub.py`.
`npm run test:integration:backend` path runs against separately started UI and
FastAPI processes using the loopback provider in `tests/fixtures/llm-stub.py`.
It is intentionally not part of CI because it orchestrates sibling-repository
processes; it never needs a live provider key.

## Repository structure

Expand Down
15 changes: 7 additions & 8 deletions docs/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ requests are outside this record.

This is dated evidence for the initial backend revision named below, not a
statement of the current FastAPI contract. The current contract is maintained in
[ui-foundation.md](ui-foundation.md): successful project history now includes the
assistant reply and provider failures return HTTP 502. The integration fixture and
UI copy still encode the older history expectation and require a functional
follow-up before this check can be rerun against current FastAPI `main`.
[ui-foundation.md](ui-foundation.md): successful project history includes the
assistant reply and provider failures return HTTP 502. The optional
`npm run test:integration:backend` fixture now checks that current contract.

| Check | Result |
| ------------------------------------------------------------------- | --------------------------------------------------------------------------- |
Expand All @@ -34,10 +33,10 @@ Browser → Next route handler → public backend
is disabled and its SQLite database is disposable. There are no browser API
mocks in this check and no real provider credentials are used.

The UI creates a project, displays a reply and reloads the saved input request
after reopening the route. It explicitly verifies that the assistant response
does not reappear after reload, matching the backend's current persistence
contract. Health 200 and optional behavior 404 are also checked.
The UI creates a project, displays a reply and reloads the successful transcript
after reopening the route. The current integration fixture verifies that both
the submitted message and assistant reply persist. Health 200 and optional
behavior 404 are also checked.

A regression covers Next's internal hostname differing from the browser Host.
The proxy accepts valid same-origin POSTs while rejecting cross-origin writes.
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"test:watch": "vitest",
"test:e2e": "playwright test",
"test:integration:automation": "node tests/integration/automation-proxy.mjs",
"test:integration:backend": "node tests/integration/real-backend.mjs",
"check": "npm run typecheck && npm run lint && npm test",
"format:check": "prettier --check .",
"format": "prettier --write ."
Expand Down
7 changes: 2 additions & 5 deletions tests/integration/real-backend.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,15 @@ try {
await page.goto(`${base}${projectPath}`);
await page.getByText("История запросов проекта", { exact: true }).click();
await expect(page.getByText(/user: Проверка приложения/)).toBeVisible();
// The backend stored only the input; do not pretend the reply persisted.
await expect(
page.getByText("Локальная проверка: Проверка приложения", { exact: true }),
).toHaveCount(0);
await expect(page.getByText(/assistant: Локальная проверка: Проверка приложения/)).toBeVisible();
await page.setViewportSize({ width: 390, height: 844 });
await page.screenshot({ path: `${destination}/project-mobile-dark.png`, fullPage: true });
expect(errors).toEqual([]);
console.log(
JSON.stringify({
result: "PASS",
stack: "browser -> Next proxy -> real FastAPI -> explicit loopback LLM fixture",
persistedRequestVerified: true,
persistedTranscriptVerified: true,
provider: "fixture",
projectPath,
screenshots: destination,
Expand Down
Loading