Skip to content

Commit

Permalink
feat: exclude auraenabled as valid annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
madhur310 committed Jan 13, 2025
1 parent 3b9c37a commit 945ef4d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/salesforcedx-vscode-apex/src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down
13 changes: 12 additions & 1 deletion packages/salesforcedx-vscode-apex/test/jest/settings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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', []);
});
});

0 comments on commit 945ef4d

Please sign in to comment.