From 55ba1c6788cad2da70a5df49d27bcf3430d8cf4b Mon Sep 17 00:00:00 2001 From: John McLear Date: Sun, 17 May 2026 22:07:15 +0100 Subject: [PATCH] test: pin updates.tier="off" default in test settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Source-level lint that fails fast if `updates.tier` in src/tests/settings.json is reverted from "off" back to "notify" (the implicit default). Addresses Qodo review note on #7800: "This PR changes test runtime behavior by setting updates.tier to off, but the PR diff does not include any regression test to ensure the version-badge cannot block chat-icon clicks if the setting is reverted." The actual functional regression (badge blocking #chaticon) is already covered by every chat.spec.ts click — they'd time out again under "notify" once any new major drops on GitHub. This new pin-test catches the regression at lint time instead, so we don't need a downstream npm release to trigger it. Same pattern as backend-tests-flake-mitigation.test.ts: cheap source-level lint guarding a behavioural invariant that lives in config. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../specs/test-settings-updater-off.test.ts | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/tests/backend-new/specs/test-settings-updater-off.test.ts diff --git a/src/tests/backend-new/specs/test-settings-updater-off.test.ts b/src/tests/backend-new/specs/test-settings-updater-off.test.ts new file mode 100644 index 000000000..1204ac0ae --- /dev/null +++ b/src/tests/backend-new/specs/test-settings-updater-off.test.ts @@ -0,0 +1,38 @@ +'use strict'; + +// Source-level pin for src/tests/settings.json having `updates.tier: "off"`. +// +// Why this exists (#7800): +// v2.7.x introduced the pad version-badge — an absolutely-positioned banner +// at bottom-right (z-index 9999) that renders when /api/version-status +// reports the running core is at least one major behind the latest GitHub +// release. It intercepts pointer events on #chaticon (same corner, +// z-index 400). Every Playwright spec that clicks the chat icon then +// times out. +// +// With `updates.tier: "off"`, `expressCreateServer` in +// node/hooks/express/updateStatus.ts short-circuits and never registers +// /api/version-status — the client fetch 404s and the badge stays hidden. +// +// This setting is easy to silently revert during a settings reshuffle. +// The lint here is cheap insurance: keep the default at "off" so any +// downstream plugin that does `cp src/tests/settings.json settings.json` +// against this core gets the fix for free. +// +// If you genuinely need the updater on for a specific test scenario, set +// it in that test's local fixture — don't change the shared default. + +import {readFileSync} from 'fs'; +import {join} from 'path'; +import {describe, it, expect} from 'vitest'; + +const repoRoot = join(__dirname, '..', '..', '..', '..'); +const read = (rel: string) => readFileSync(join(repoRoot, rel), 'utf8'); + +describe('test-settings updater default (#7800)', () => { + it('src/tests/settings.json sets updates.tier="off"', () => { + const json = JSON.parse(read('src/tests/settings.json')); + expect(json.updates, 'updates block must be present').toBeDefined(); + expect(json.updates.tier).toBe('off'); + }); +});