From 389bdd3306edcd9f9a84b18f0751a84cb41a47d4 Mon Sep 17 00:00:00 2001 From: Light1YT Date: Tue, 23 Jun 2026 11:25:33 +0500 Subject: [PATCH] test(ptica): use tracked mock fixtures instead of git-excluded __preview (CI fix) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../ptica/__tests__/ptica-adapt.honesty.test.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/site-finder/ptica/__tests__/ptica-adapt.honesty.test.ts b/frontend/src/components/site-finder/ptica/__tests__/ptica-adapt.honesty.test.ts index e24fcf88..1029d081 100644 --- a/frontend/src/components/site-finder/ptica/__tests__/ptica-adapt.honesty.test.ts +++ b/frontend/src/components/site-finder/ptica/__tests__/ptica-adapt.honesty.test.ts @@ -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 })