From fdd1b47b03185df5aac7c39aa30d859ac07bc5cc Mon Sep 17 00:00:00 2001 From: madhur310 Date: Mon, 13 Jan 2025 14:03:19 -0800 Subject: [PATCH] feat: exclude auraenabled as valid annotation (#6005) --- packages/salesforcedx-vscode-apex/src/settings.ts | 3 ++- .../test/jest/settings.test.ts | 13 ++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/salesforcedx-vscode-apex/src/settings.ts b/packages/salesforcedx-vscode-apex/src/settings.ts index 4686a6d86c..a823c998a7 100644 --- a/packages/salesforcedx-vscode-apex/src/settings.ts +++ b/packages/salesforcedx-vscode-apex/src/settings.ts @@ -17,7 +17,8 @@ const APEX_ACTION_PROP_DEF_MODIFIERS = ['static']; const APEX_ACTION_PROP_ACCESS_MODIFIERS = ['global', 'public']; const APEX_ACTION_CLASS_REST_ANNOTATION = ['RestResource']; const APEX_ACTION_METHOD_REST_ANNOTATION = ['HttpDelete', 'HttpGet', 'HttpPatch', 'HttpPost', 'HttpPut']; -const APEX_ACTION_METHOD_ANNOTATION = ['AuraEnabled']; +// 'AuraEnabled' was removed for W-17550288 and should be added back with W-17579102 +const APEX_ACTION_METHOD_ANNOTATION: string[] = []; // Default eligibility for general OAS generation. Users can changed the setting through VSCode configurations const DEFAULT_CLASS_ACCESS_MODIFIERS = ['global', 'public']; diff --git a/packages/salesforcedx-vscode-apex/test/jest/settings.test.ts b/packages/salesforcedx-vscode-apex/test/jest/settings.test.ts index 19284b0f46..2baa0c6ab2 100644 --- a/packages/salesforcedx-vscode-apex/test/jest/settings.test.ts +++ b/packages/salesforcedx-vscode-apex/test/jest/settings.test.ts @@ -6,7 +6,7 @@ */ import { SFDX_CORE_CONFIGURATION_NAME } from '@salesforce/salesforcedx-utils-vscode'; import * as vscode from 'vscode'; -import { retrieveEnableSyncInitJobs, retrieveTestCodeCoverage } from '../../src/settings'; +import { retrieveAAMethodAnnotations, retrieveEnableSyncInitJobs, retrieveTestCodeCoverage } from '../../src/settings'; describe('settings Unit Tests.', () => { const vscodeMocked = jest.mocked(vscode); @@ -40,4 +40,15 @@ describe('settings Unit Tests.', () => { expect(getConfigurationMock).toHaveBeenCalledWith(); expect(getFn).toHaveBeenCalledWith('salesforcedx-vscode-apex.wait-init-jobs', true); }); + + it('Should be able to get retrieveAAMethodAnnotations setting.', () => { + getConfigurationMock.mockReturnValue({ + get: getFn.mockReturnValue(['UserDefinedModifier']) + } as any); + + const result = retrieveAAMethodAnnotations(); + expect(result).toEqual(['UserDefinedModifier']); + expect(getConfigurationMock).toHaveBeenCalledWith(); + expect(getFn).toHaveBeenCalledWith('salesforcedx-vscode-apex.apexoas.aa.method.annotations', []); + }); });