From 143451769c01edc86a882326398637fa3e2a7194 Mon Sep 17 00:00:00 2001 From: Peter Amiri Date: Mon, 19 Oct 2026 17:01:21 -0700 Subject: [PATCH] test(wheelstest): pin that gate-skipped browser specs are reported as Skipped BrowserDescribeSkipSpec only proves that a skipped browserDescribe() spec body doesn't run. Nothing checked what TestBox records for it. If the skip path went back to returning quietly instead of calling skip(), every browser spec would be counted as Passed again and that spec would still pass. A fixture under tests/resources/wheelstest forces the browser gate to skip in beforeAll(), with no Playwright or network. A new spec runs it through a nested TestBox (the same pattern as BDDRunnerErrorReportingSpec) and asserts the spec is recorded as Skipped with its reason, with no pass, fail or error. Turning the skip path into a quiet return makes the new spec fail, and flips the 32 real browser specs from Skipped to Passed. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Peter Amiri --- .../BrowserDescribeSkippedFixture.cfc | 19 +++++++++++ .../BrowserDescribeSkippedStatusSpec.cfc | 34 +++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 vendor/wheels/tests/resources/wheelstest/BrowserDescribeSkippedFixture.cfc create mode 100644 vendor/wheels/tests/specs/wheelstest/BrowserDescribeSkippedStatusSpec.cfc diff --git a/vendor/wheels/tests/resources/wheelstest/BrowserDescribeSkippedFixture.cfc b/vendor/wheels/tests/resources/wheelstest/BrowserDescribeSkippedFixture.cfc new file mode 100644 index 0000000000..0c433a76da --- /dev/null +++ b/vendor/wheels/tests/resources/wheelstest/BrowserDescribeSkippedFixture.cfc @@ -0,0 +1,19 @@ +component extends="wheels.wheelstest.BrowserTest" { + + function beforeAll() { + // No super.beforeAll(): skip before the launcher is touched, so this is + // deterministic without Playwright or a network. + $skipBrowserSpecs("Browser layer unavailable (skip-status fixture)"); + } + + function run() { + browserDescribe("skip-status fixture", () => { + it("must not execute when the gate says skip", () => { + throw( + type = "Wheels.BrowserTest.SkipFixtureExecuted", + message = "browserDescribe() ran the spec body despite a skip gate." + ); + }); + }); + } +} diff --git a/vendor/wheels/tests/specs/wheelstest/BrowserDescribeSkippedStatusSpec.cfc b/vendor/wheels/tests/specs/wheelstest/BrowserDescribeSkippedStatusSpec.cfc new file mode 100644 index 0000000000..e73b907612 --- /dev/null +++ b/vendor/wheels/tests/specs/wheelstest/BrowserDescribeSkippedStatusSpec.cfc @@ -0,0 +1,34 @@ +component extends="wheels.WheelsTest" { + + function run() { + describe("browserDescribe() skip status", () => { + + it("records a gate-skipped browser spec as Skipped, with its reason", () => { + var testBox = new wheels.wheelstest.system.TestBox( + bundles = ["wheels.tests.resources.wheelstest.BrowserDescribeSkippedFixture"] + ); + var results = testBox.runRaw(); + + // The fixture has one spec; a skip must not affect pass/fail/error. + expect(results.getTotalPass()).toBe(0); + expect(results.getTotalSkipped()).toBe(1); + expect(results.getTotalFail()).toBe(0); + expect(results.getTotalError()).toBe(0); + + var bs = results.getBundleStats(); + expect(arrayLen(bs)).toBe(1); + expect(bs[1].path).toInclude("BrowserDescribeSkippedFixture"); + expect(bs[1].totalPass).toBe(0); + expect(bs[1].totalSkipped).toBe(1); + + // Bundle -> top-level suite -> spec (created by the runner). + expect(arrayLen(bs[1].suiteStats)).toBe(1); + var specs = bs[1].suiteStats[1].specStats; + expect(arrayLen(specs)).toBe(1); + expect(Compare(specs[1].status, "Skipped")).toBe(0); + expect(Compare(specs[1].failMessage, "Browser layer unavailable (skip-status fixture)")).toBe(0); + }); + + }); + } +}