test(ptica): use tracked mock fixtures instead of git-excluded __preview (CI fix)
All checks were successful
CI / changes (pull_request) Successful in 6s
CI / frontend-tests (pull_request) Successful in 54s
CI / backend-tests (pull_request) Has been skipped
CI / openapi-codegen-check (pull_request) Successful in 1m54s

CI frontend-tests упал: honesty-тест импортировал фикстуры из
src/app/%5F%5Fpreview/ptica/__fixtures__/ — эта dev-only директория в
.git/info/exclude, поэтому отсутствует в Linux CI checkout (vite:import-analysis
'Failed to resolve import'). Локально (macOS) резолвилось т.к. файлы на диске.

Переключил импорт на tracked src/lib/mocks/parcel-{forecast,analyze}.json
(NEXT_PUBLIC_USE_MOCKS source, в git) — report.exec_summary.key_numbers.
deficit_index присутствует, shape совместим. 138/138 vitest passed.

Refs #1871
This commit is contained in:
Light1YT 2026-06-23 11:25:33 +05:00
parent 2303207629
commit 389bdd3306

View file

@ -24,8 +24,11 @@ import {
import type { ParcelAnalysis } from "@/types/site-finder";
import type { ForecastReport } from "@/types/forecast";
import forecastFixture from "@/app/%5F%5Fpreview/ptica/__fixtures__/forecast.json";
import analyzeFixture from "@/app/%5F%5Fpreview/ptica/__fixtures__/analyze.json";
// Tracked mock fixtures (NEXT_PUBLIC_USE_MOCKS source). The dev-only
// __preview/ptica/__fixtures__ dir is git-excluded, so it is absent in CI —
// these committed mocks keep the suite reproducible on the Linux runner.
import forecastFixture from "@/lib/mocks/parcel-forecast.json";
import analyzeFixture from "@/lib/mocks/parcel-analyze.json";
const analysis = analyzeFixture as unknown as ParcelAnalysis;
const baseReport = (forecastFixture as { report: unknown })