import type { ReactElement, ReactNode } from 'react' import { render, screen } from '@testing-library/react' type ConfigState = { isCeEdition: boolean isProd: boolean } type GaProps = { gaType: string } type GaRenderFn = (props: GaProps) => Promise type GaTypeValue = 'admin' | 'webapp' const { mockHeaders, mockHeadersGet, configState } = vi.hoisted(() => ({ mockHeaders: vi.fn(), mockHeadersGet: vi.fn(), configState: ({ isCeEdition: false, isProd: true, }) as ConfigState, })) vi.mock('@/config', () => ({ get IS_CE_EDITION() { return configState.isCeEdition }, get IS_PROD() { return configState.isProd }, })) vi.mock('@/next/headers', () => ({ headers: mockHeaders, })) vi.mock('@/next/script', () => ({ default: ({ id, strategy, src, nonce, dangerouslySetInnerHTML, }: { id?: string strategy?: string src?: string nonce?: string dangerouslySetInnerHTML?: { __html?: string } }) => (