import { act, render, screen, waitFor } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import type { ComponentProps } from "react"; import { openCookiePreferences } from "@/lib/analytics"; import GoogleAnalytics from "./GoogleAnalytics"; /** * Testes de caminhos-base de GoogleAnalytics (complemento de GoogleAnalytics.test.tsx): * modo de desenvolvimento, teclas da barra, reaceite, nova concessão depois de revogar, * cookies de analytics x outros cookies, reaproveitamento de gtag/dataLayer e recuperação de falha de gravação. */ jest.mock("next/script", () => ({ __esModule: true, default: ({ strategy: _strategy, ...props }: ComponentProps<"script"> & { strategy?: string }) =>