@@ -22,6 +22,7 @@ import {
2222 SfCommandlet
2323} from '../utils/commandletHelpers' ;
2424import { ApexTestQuickPickItem } from '../utils/fileHelpers' ;
25+ import { getFullClassName , isFlowTest } from '../utils/testUtils' ;
2526import { getTestController } from '../views/testController' ;
2627import { ApexLibraryTestRunExecutor } from './apexTestRun' ;
2728
@@ -30,14 +31,19 @@ type ApexTestSuiteOptions = { suitename: string; tests: string[] };
3031const listApexClassItems = async ( ) : Promise < ApexTestQuickPickItem [ ] > => {
3132 const result = await getApexTestingRuntime ( ) . runPromise ( discoverTests ( ) ) ;
3233 return result . classes
34+ . filter ( cls => ! isFlowTest ( cls ) )
3335 . map (
3436 ( cls ) : ApexTestQuickPickItem => ( {
3537 label : cls . name ,
3638 description : cls . namespacePrefix ?? '' ,
37- type : 'Class'
39+ type : 'Class' ,
40+ fullClassName : getFullClassName ( cls )
3841 } )
3942 )
40- . toSorted ( ( a , b ) : number => a . label . localeCompare ( b . label ) ) ;
43+ . toSorted ( ( a , b ) : number => {
44+ const byLabel = a . label . localeCompare ( b . label ) ;
45+ return byLabel !== 0 ? byLabel : ( a . fullClassName ?? '' ) . localeCompare ( b . fullClassName ?? '' ) ;
46+ } ) ;
4147} ;
4248
4349const listApexTestSuiteItems = async ( ) : Promise < ApexTestQuickPickItem [ ] > => {
@@ -75,7 +81,9 @@ class TestSuiteBuilder implements ParametersGatherer<ApexTestSuiteOptions> {
7581 if ( ! apexClassSelection || apexClassSelection . length === 0 ) {
7682 return { type : 'CANCEL' } ;
7783 }
78- const apexClassNames = apexClassSelection . map ( selection => selection . label ) ;
84+ const apexClassNames = apexClassSelection . map (
85+ selection => selection . fullClassName ?? selection . label
86+ ) ;
7987 return {
8088 type : 'CONTINUE' ,
8189 data : { suitename : testSuiteName . label , tests : apexClassNames }
@@ -122,7 +130,9 @@ class TestSuiteCreator implements ParametersGatherer<ApexTestSuiteOptions> {
122130 if ( ! apexClassSelection || apexClassSelection . length === 0 ) {
123131 return { type : 'CANCEL' } ;
124132 }
125- const apexClassNames = apexClassSelection . map ( selection => selection . label ) ;
133+ const apexClassNames = apexClassSelection . map (
134+ selection => selection . fullClassName ?? selection . label
135+ ) ;
126136 return {
127137 type : 'CONTINUE' ,
128138 data : { suitename : testSuiteName , tests : apexClassNames }
0 commit comments