From 4fb90af4e5429e6e29aa607a4785f709e1c03840 Mon Sep 17 00:00:00 2001 From: Myasnikov Daniil Date: Fri, 28 Aug 2026 15:21:24 +0500 Subject: [PATCH] test(dashboard): anchor the addon description test on the no-toggle branch The test asserted that the schema description renders and that neither piece of removed copy does, but the default renderer prints the description too and has never carried that copy, so the assertions held whether or not the no-toggle branch was taken: forcing hasNoToggle false left this one green while its three siblings failed. Assert the branch's own notice alongside the description. Assisted-by: LLM Signed-off-by: Myasnikov Daniil --- .../components/CustomObjectFieldTemplate.notoggle.test.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/system/dashboard/images/console/apps/console/src/components/CustomObjectFieldTemplate.notoggle.test.tsx b/packages/system/dashboard/images/console/apps/console/src/components/CustomObjectFieldTemplate.notoggle.test.tsx index 401f9d450..de6df1fba 100644 --- a/packages/system/dashboard/images/console/apps/console/src/components/CustomObjectFieldTemplate.notoggle.test.tsx +++ b/packages/system/dashboard/images/console/apps/console/src/components/CustomObjectFieldTemplate.notoggle.test.tsx @@ -48,6 +48,10 @@ describe("addons with no enable switch", () => { properties={[prop("valuesOverride")]} />, ) + // Anchor on the no-toggle branch: the default renderer also prints the + // description and neither forbidden phrase, so without this the assertions + // below hold whether or not the branch was taken. + expect(screen.getByText(/No enable switch/)).toBeTruthy() expect(screen.getByText(/together with addons.monitoringAgents.enabled/)).toBeTruthy() expect(screen.queryByText(/cannot be disabled/)).toBeNull() expect(screen.queryByText(/Always on/)).toBeNull()