@@ -623,6 +623,63 @@ describe('ComponentSetBuilder', () => {
623
623
expect ( compSet . has ( apexClassWildcardMatch ) ) . to . equal ( true ) ;
624
624
} ) ;
625
625
626
+ it ( 'should exclude folder type when excluding a type that is stored in folders' , async ( ) => {
627
+ const packageDir1 = path . resolve ( 'force-app' ) ;
628
+ const registry = new RegistryAccess ( ) ;
629
+ const dashboardType = registry . getTypeByName ( 'Dashboard' ) ;
630
+ const dashboardFolderType = registry . getTypeByName ( 'DashboardFolder' ) ;
631
+
632
+ fromConnectionStub . resolves ( new ComponentSet ( ) ) ;
633
+ await ComponentSetBuilder . build ( {
634
+ sourcepath : undefined ,
635
+ manifest : undefined ,
636
+ metadata : {
637
+ metadataEntries : [ ] ,
638
+ excludedEntries : [ 'Dashboard' ] ,
639
+ directoryPaths : [ packageDir1 ] ,
640
+ } ,
641
+ org : {
642
+ username : testOrg . username ,
643
+ exclude : [ ] ,
644
+ } ,
645
+ } ) ;
646
+
647
+ expect ( fromConnectionStub . callCount ) . to . equal ( 1 ) ;
648
+ const fromConnectionArgs = fromConnectionStub . firstCall . args [ 0 ] ;
649
+ const expectedMdTypes = Object . values ( registry . getRegistry ( ) . types )
650
+ . filter ( ( t ) => t . name !== dashboardType . name && t . name !== dashboardFolderType . name )
651
+ . map ( ( t ) => t . name ) ;
652
+ expect ( fromConnectionArgs ) . to . have . deep . property ( 'metadataTypes' , expectedMdTypes ) ;
653
+ } ) ;
654
+
655
+ it ( 'should not exclude folder type when excluding a type that is not stored in folders' , async ( ) => {
656
+ const packageDir1 = path . resolve ( 'force-app' ) ;
657
+ const registry = new RegistryAccess ( ) ;
658
+ const apexClassType = registry . getTypeByName ( 'ApexClass' ) ;
659
+
660
+ fromConnectionStub . resolves ( new ComponentSet ( ) ) ;
661
+ await ComponentSetBuilder . build ( {
662
+ sourcepath : undefined ,
663
+ manifest : undefined ,
664
+ metadata : {
665
+ metadataEntries : [ ] ,
666
+ excludedEntries : [ 'ApexClass' ] ,
667
+ directoryPaths : [ packageDir1 ] ,
668
+ } ,
669
+ org : {
670
+ username : testOrg . username ,
671
+ exclude : [ ] ,
672
+ } ,
673
+ } ) ;
674
+
675
+ expect ( fromConnectionStub . callCount ) . to . equal ( 1 ) ;
676
+ const fromConnectionArgs = fromConnectionStub . firstCall . args [ 0 ] ;
677
+ const expectedMdTypes = Object . values ( registry . getRegistry ( ) . types )
678
+ . filter ( ( t ) => t . name !== apexClassType . name )
679
+ . map ( ( t ) => t . name ) ;
680
+ expect ( fromConnectionArgs ) . to . have . deep . property ( 'metadataTypes' , expectedMdTypes ) ;
681
+ } ) ;
682
+
626
683
describe ( 'Agent pseudo type' , ( ) => {
627
684
const genAiPlannerId = '16jSB000000H3JFYA0' ;
628
685
const genAiPlannerId15 = '16jSB000000H3JF' ;
0 commit comments