From dc9fb1deb70de8ddd1a278115d63040820d1a1ab Mon Sep 17 00:00:00 2001 From: adm01-debug Date: Tue, 19 May 2026 16:56:26 -0300 Subject: [PATCH] fix(tests): atualizar imports de hooks movidos para subpastas MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 3 testes de smoke em tests/hooks/ estavam quebrando com 'Failed to resolve import' no CI (job 76823255050, run 26121173456) porque referenciavam paths antigos de hooks que foram movidos para subpastas em commits 4df6ecf e 95bac00 (ambos de 19/mai). Imports corrigidos: - @/hooks/useComparisonSync -> @/hooks/comparison/useComparisonSync - @/hooks/usePrintAreas -> @/hooks/simulation/usePrintAreas - @/hooks/productsCustomizationOptions-> @/hooks/products/useProductCustomizationOptions (o terceiro tinha um typo adicional: faltava 'use' no inicio do path e o 's' de products estava plural — o nome correto do hook exportado e' useProductCustomizationOptions e fica em src/hooks/products/.) Validacao local (mesma versao de Node do CI, v20.20.2): npx vitest run \ tests/hooks/catalog-comparison-smoke.test.ts \ tests/hooks/usePrintAreas.smoke.test.ts \ tests/hooks/useProductCustomizationOptions.smoke.test.ts Resultado: 3 test files / 6 tests passed (309ms tests, 9.11s total). Refs: run 26121173456 / job 76823255050 --- tests/hooks/catalog-comparison-smoke.test.ts | 2 +- tests/hooks/usePrintAreas.smoke.test.ts | 2 +- tests/hooks/useProductCustomizationOptions.smoke.test.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/hooks/catalog-comparison-smoke.test.ts b/tests/hooks/catalog-comparison-smoke.test.ts index e2c6c5349..8e26f4d3f 100644 --- a/tests/hooks/catalog-comparison-smoke.test.ts +++ b/tests/hooks/catalog-comparison-smoke.test.ts @@ -13,7 +13,7 @@ vi.mock("@/contexts/OrganizationContext", () => ({ })); import { useCatalogFiltering } from "@/hooks/products"; -import { useComparisonSync } from "@/hooks/useComparisonSync"; +import { useComparisonSync } from "@/hooks/comparison/useComparisonSync"; import { smokeHook } from "./_helpers/smoke-template"; // Proxy que retorna [] para qualquer campo de array acessado, evitando crash diff --git a/tests/hooks/usePrintAreas.smoke.test.ts b/tests/hooks/usePrintAreas.smoke.test.ts index 5231b9ffc..18a4fde36 100644 --- a/tests/hooks/usePrintAreas.smoke.test.ts +++ b/tests/hooks/usePrintAreas.smoke.test.ts @@ -17,7 +17,7 @@ vi.mock("@/integrations/supabase/client", () => ({ import { renderHookWithProviders } from "./_helpers/render-hook-providers"; import { supabase } from "@/integrations/supabase/client"; -import { usePrintAreas } from "@/hooks/usePrintAreas"; +import { usePrintAreas } from "@/hooks/simulation/usePrintAreas"; import { PRINT_AREA_ROW_PT, TABELA_PRECO_ROW_PT } from "../fixtures/personalization-payloads"; beforeEach(() => { diff --git a/tests/hooks/useProductCustomizationOptions.smoke.test.ts b/tests/hooks/useProductCustomizationOptions.smoke.test.ts index 332d3a4c6..f72179460 100644 --- a/tests/hooks/useProductCustomizationOptions.smoke.test.ts +++ b/tests/hooks/useProductCustomizationOptions.smoke.test.ts @@ -22,7 +22,7 @@ vi.mock("@/lib/external-rpc", () => ({ import { renderHookWithProviders } from "./_helpers/render-hook-providers"; import { invokeExternalRpc } from "@/lib/external-rpc"; -import { useProductCustomizationOptions } from "@/hooks/productsCustomizationOptions"; +import { useProductCustomizationOptions } from "@/hooks/products/useProductCustomizationOptions"; import { OPTIONS_PAYLOAD_PT } from "../fixtures/personalization-payloads"; const mockedRpc = invokeExternalRpc as unknown as ReturnType;