[lts-active] Fix google tag manager e2e test, assume GTM 200s instead of 404ing (#100011)
Backports [Fix google tag manager e2e test, assume GTM 200s instead of 404ing (#99896)](https://github.com/vercel/next.js/pull/99896) to `releases/lts/active`. This is a test-only change, cherry-picked cleanly from `canary` with `-x`. The GTM script now returns 200 for the fake tag id (it used to 404) and pushes its own `dataLayer` events. That makes `@next/third-parties basic usage › renders GTM` fail on every LTS CI run, for example on #100008. The tests now wait for GTM/GA to initialize and assert only on the events they care about. ## Verification - Baseline with the LTS test files: `renders GTM` fails in both `test/e2e/third-parties/index.test.ts` and `test/e2e/app-dir/third-parties/basic.test.ts` (`dataLayer.length` 3 vs 1), matching CI. - With this change, both suites pass 8/8 in Turbopack dev and start and in webpack dev and start, against the real GTM script. <!-- NEXT_JS_LLM --> <!-- fleet 652922cb-dc34-493d-9be5-c241a5164cad --> Co-authored-by:vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com> Co-authored-by:
Benjamin Woodruff <benjamin.woodruff@vercel.com> Co-authored-by:
Tobias Koppers <1365881+sokra@users.noreply.github.com>
Showing
Please
register
or
sign in
to comment