diff --git a/functions.php b/functions.php index 1d8f4a8..8da9bf5 100644 --- a/functions.php +++ b/functions.php @@ -166,8 +166,8 @@ function radiate_scripts() { wp_enqueue_script( 'comment-reply' ); } - wp_enqueue_script( 'html5shiv', get_template_directory_uri() . '/js/html5shiv.js', array(), '3.7.3', false ); - wp_script_add_data( 'html5shiv', 'conditional', 'lte IE 8' ); + // Empty handle kept so scripts that list 'html5shiv' as a dependency still load. + wp_register_script( 'html5shiv', false, array(), wp_get_theme()->get( 'Version' ), false ); } diff --git a/tests/e2e/specs/homepage/front-page-health.spec.ts b/tests/e2e/specs/homepage/front-page-health.spec.ts index 929dae9..9e7a5a3 100644 --- a/tests/e2e/specs/homepage/front-page-health.spec.ts +++ b/tests/e2e/specs/homepage/front-page-health.spec.ts @@ -50,24 +50,28 @@ test("skip link is the first Tab stop and targets the content region @fresh @hom await expect(page.locator("#content")).toHaveCount(1); }); -// Quarantined: not fixed yet and no issue filed. Drop `.fixme` in the PR that fixes it. /** * @area homepage * @tier fresh + * @guards themegrill/radiate-pro#38 * @source human 2026-09-24 - * @why functions.php:170 registers html5shiv with + * @why functions.php registered html5shiv with * wp_script_add_data( 'html5shiv', 'conditional', 'lte IE 8' ), which * WordPress 6.9+ deprecates, so every front-end page prints a * "Deprecated: WP_Dependencies->add_data()" notice when WP_DEBUG_DISPLAY * is on (confirmed on test-theme.local, WP 7.1). Only observable where * debug display is enabled; on a site with it off this passes regardless. - * Asserts no PHP notice markup in the body, not the absence of html5shiv. + * Asserts no PHP notice markup anywhere in the response (it is printed + * inside
), not the absence of html5shiv. */ -test.fixme("front page prints no PHP notices or deprecations @fresh @homepage", async ({ +test("front page prints no PHP notices or deprecations @fresh @homepage", async ({ page, }) => { - await page.goto("/"); - await expect(page.locator("body")).not.toContainText( - /(Deprecated|Notice|Warning|Fatal error):\s/, + // Read the raw response: PHP prints the notice while wp_head() runs, before + // , so a body locator would miss it. + const response = await page.goto("/"); + const html = await response!.text(); + expect(html).not.toMatch( + /(?:^|>|\s)(?:)?(?:Deprecated|Notice|Warning|Fatal error)(?:<\/b>)?:\s/, ); });