@@ -177,6 +177,31 @@ describe('ComponentSetBuilder', () => {
177
177
expect ( compSet . has ( { type : 'ApexClass' , fullName : '*' } ) ) . to . equal ( true ) ;
178
178
} ) ;
179
179
180
+ it ( 'should create ComponentSet from metadata with spaces between : (ApexClass: MyApexClass)' , async ( ) => {
181
+ componentSet . add ( apexClassComponent ) ;
182
+ fromSourceStub . returns ( componentSet ) ;
183
+ const packageDir1 = path . resolve ( 'force-app' ) ;
184
+
185
+ const compSet = await ComponentSetBuilder . build ( {
186
+ sourcepath : undefined ,
187
+ manifest : undefined ,
188
+ metadata : {
189
+ metadataEntries : [ 'ApexClass: MyApexClass' ] ,
190
+ directoryPaths : [ packageDir1 ] ,
191
+ } ,
192
+ } ) ;
193
+ expect ( fromSourceStub . calledOnce ) . to . equal ( true ) ;
194
+ const fromSourceArgs = fromSourceStub . firstCall . args [ 0 ] as FromSourceOptions ;
195
+ expect ( fromSourceArgs ) . to . have . deep . property ( 'fsPaths' , [ packageDir1 ] ) ;
196
+ const filter = new ComponentSet ( ) ;
197
+ filter . add ( { type : 'ApexClass' , fullName : 'MyApexClass' } ) ;
198
+ expect ( fromSourceArgs ) . to . have . property ( 'include' ) ;
199
+ expect ( fromSourceArgs . include . getSourceComponents ( ) ) . to . deep . equal ( filter . getSourceComponents ( ) ) ;
200
+ expect ( compSet . size ) . to . equal ( 2 ) ;
201
+ expect ( compSet . has ( apexClassComponent ) ) . to . equal ( true ) ;
202
+ expect ( compSet . has ( { type : 'ApexClass' , fullName : 'MyApexClass' } ) ) . to . equal ( true ) ;
203
+ } ) ;
204
+
180
205
it ( 'should throw an error when it cant resolve a metadata type (Metadata)' , async ( ) => {
181
206
const packageDir1 = path . resolve ( 'force-app' ) ;
182
207
0 commit comments