diff --git a/jest.config.ts b/jest.config.ts index d8333013..dfdbc49b 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -2,11 +2,9 @@ import type { Config } from 'jest'; import nextJest from 'next/jest.js'; const createJestConfig = nextJest({ - // Provide the path to your Next.js app to load next.config.js and .env files in your test environment dir: './', }); -// Add any custom config to be passed to Jest const config: Config = { coverageProvider: 'v8', testEnvironment: 'jsdom', @@ -49,5 +47,4 @@ const config: Config = { ], }; -// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async export default createJestConfig(config); diff --git a/jest.setup.ts b/jest.setup.ts index 167b65bd..52c5e812 100644 --- a/jest.setup.ts +++ b/jest.setup.ts @@ -1,19 +1,16 @@ import '@testing-library/jest-dom'; -// Configurar variables de entorno para los tests process.env.APP_ENV = 'test'; process.env.DEV_CACHE_ENABLED = 'true'; global.console.warn = jest.fn(); -// Polyfill para structuredClone si no está disponible (Node < 17) if (typeof global.structuredClone === 'undefined') { global.structuredClone = (obj: any) => { return JSON.parse(JSON.stringify(obj)); }; } -// Polyfill para Request y Response (necesario para el SDK de Polar) global.Request = global.Request || class Request { diff --git a/next-env.d.ts b/next-env.d.ts index 9edff1c7..c4b7818f 100644 --- a/next-env.d.ts +++ b/next-env.d.ts @@ -1,6 +1,6 @@ /// /// -import "./.next/types/routes.d.ts"; +import "./.next/dev/types/routes.d.ts"; // NOTE: This file should not be edited // see https://nextjs.org/docs/app/api-reference/config/typescript for more information. diff --git a/packages/theme-studio/src/presentation/components/ThemeStudio.tsx b/packages/theme-studio/src/presentation/components/ThemeStudio.tsx index b29e12a5..1f386731 100644 --- a/packages/theme-studio/src/presentation/components/ThemeStudio.tsx +++ b/packages/theme-studio/src/presentation/components/ThemeStudio.tsx @@ -1,7 +1,3 @@ -/* - * Theme Studio - Presentación (sin Polaris Frame para evitar scroll) - */ - 'use client'; import { Sidebar } from './sidebar/Sidebar'; diff --git a/packages/theme-studio/src/presentation/utils/iframe-selection-script.js b/packages/theme-studio/src/presentation/utils/iframe-selection-script.js index 03578cfb..083b9f3f 100644 --- a/packages/theme-studio/src/presentation/utils/iframe-selection-script.js +++ b/packages/theme-studio/src/presentation/utils/iframe-selection-script.js @@ -67,6 +67,9 @@ export function iframeSelectionScript(storeDomain) { return `(function() { 'use strict'; + if (window.self === window.top) { + return; + } var NS_KEY = '__FASTTIFY_THEME_STUDIO_NS__'; if (window[NS_KEY]) { return;