import type { ReactElement, ReactNode } from 'react' import { render, screen } from '@testing-library/react' type ConfigState = { isCloudEdition: boolean isProd: boolean } type GoogleAnalyticsScriptsRenderFn = () => Promise const { mockHeaders, mockHeadersGet, configState } = vi.hoisted(() => ({ mockHeaders: vi.fn(), mockHeadersGet: vi.fn(), configState: { isCloudEdition: true, isProd: true, } as ConfigState, })) vi.mock('@/config', () => ({ get IS_CLOUD_EDITION() { return configState.isCloudEdition }, get IS_PROD() { return configState.isProd }, })) vi.mock('@/next/headers', () => ({ headers: mockHeaders, })) vi.mock('@/next/script', () => ({ default: ({ id, strategy, src, nonce, children, }: { id?: string strategy?: string src?: string nonce?: string children?: ReactNode }) => (