From 65b91448bd7eeab77e2fc6d05cd877314f92cc56 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 17 Feb 2026 08:20:49 +0000 Subject: [PATCH] Add consistency tests for perf toggle CI fallback Co-authored-by: Julius Marminge --- apps/desktop/src/perfConfig.test.ts | 44 +++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/apps/desktop/src/perfConfig.test.ts b/apps/desktop/src/perfConfig.test.ts index 0de69a9155..21490f5c0e 100644 --- a/apps/desktop/src/perfConfig.test.ts +++ b/apps/desktop/src/perfConfig.test.ts @@ -293,3 +293,47 @@ describe("shouldRunBenchmarkThreadSweep", () => { ).toBe(true); }); }); + +describe("toggle fallback consistency", () => { + it("applies the same CI-aware fallback to all perf toggles", () => { + const unknownValue = { value: "maybe" }; + + expect( + shouldRunTerminalPerfInteractions({ + T3CODE_DESKTOP_PERF_RUN_TERMINAL: unknownValue.value, + CI: "true", + }), + ).toBe(false); + expect( + shouldRunOptionalRendererPerfInteractions({ + T3CODE_DESKTOP_PERF_RUN_OPTIONAL_RENDERER: unknownValue.value, + CI: "true", + }), + ).toBe(false); + expect( + shouldRunBenchmarkThreadSweep({ + T3CODE_DESKTOP_PERF_RUN_BENCHMARK_SWEEP: unknownValue.value, + CI: "true", + }), + ).toBe(false); + + expect( + shouldRunTerminalPerfInteractions({ + T3CODE_DESKTOP_PERF_RUN_TERMINAL: unknownValue.value, + CI: "false", + }), + ).toBe(true); + expect( + shouldRunOptionalRendererPerfInteractions({ + T3CODE_DESKTOP_PERF_RUN_OPTIONAL_RENDERER: unknownValue.value, + CI: "false", + }), + ).toBe(true); + expect( + shouldRunBenchmarkThreadSweep({ + T3CODE_DESKTOP_PERF_RUN_BENCHMARK_SWEEP: unknownValue.value, + CI: "false", + }), + ).toBe(true); + }); +});