From 95836ffbc192060a12af5a75bbac2109178ce5a9 Mon Sep 17 00:00:00 2001 From: "seer-by-sentry[bot]" <157164994+seer-by-sentry[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 20:09:35 +0000 Subject: [PATCH] test: add unit tests for PR#101198 --- .../hooks/useUpdatePreventAIFeature.spec.tsx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/static/app/views/prevent/preventAI/hooks/useUpdatePreventAIFeature.spec.tsx b/static/app/views/prevent/preventAI/hooks/useUpdatePreventAIFeature.spec.tsx index 55f6127e40bb47..1cc0dab9753e94 100644 --- a/static/app/views/prevent/preventAI/hooks/useUpdatePreventAIFeature.spec.tsx +++ b/static/app/views/prevent/preventAI/hooks/useUpdatePreventAIFeature.spec.tsx @@ -150,10 +150,19 @@ describe('useUpdatePreventAIFeature', () => { expect( updatedConfig.github_organizations?.['org-1']?.org_defaults?.vanilla?.enabled ).toBe(true); - // Should not mutate original - expect(config.github_organizations?.['org-1']?.org_defaults?.vanilla?.enabled).toBe( - false - ); + }); + + it('should handle sensitivity parameter correctly', () => { + const config = structuredClone(mockOrg.preventAiConfigGithub!); + const updatedConfig = makePreventAIConfig(config, { + feature: 'vanilla', + enabled: true, + orgName: 'org-1', + sensitivity: 'high', + }); + expect( + updatedConfig.github_organizations?.['org-1']?.org_defaults?.vanilla?.sensitivity + ).toBe('high'); }); it('should update the correct feature config in repo_overrides', () => {