@@ -819,6 +819,63 @@ describe('MetadataApiDeploy', () => {
819
819
expect ( responses ) . to . deep . equal ( expected ) ;
820
820
} ) ;
821
821
822
+ it ( 'should not report duplicates component' , ( ) => {
823
+ const component = matchingContentFile . COMPONENT ;
824
+ const deployedSet = new ComponentSet ( [ component ] ) ;
825
+ const { fullName, type, content } = component ;
826
+ const problem = 'something went wrong' ;
827
+ const problemType = 'Error' ;
828
+ const apiStatus : Partial < MetadataApiDeployStatus > = {
829
+ details : {
830
+ componentFailures : [
831
+ {
832
+ changed : 'false' ,
833
+ created : 'false' ,
834
+ deleted : 'false' ,
835
+ success : 'false' ,
836
+ lineNumber : '3' ,
837
+ columnNumber : '5' ,
838
+ problem,
839
+ problemType,
840
+ fullName,
841
+ fileName : component . content ,
842
+ componentType : type . name ,
843
+ } as DeployMessage ,
844
+ {
845
+ changed : 'false' ,
846
+ created : 'false' ,
847
+ deleted : 'false' ,
848
+ success : 'false' ,
849
+ lineNumber : '3' ,
850
+ columnNumber : '5' ,
851
+ problem,
852
+ problemType,
853
+ fullName,
854
+ fileName : component . content ,
855
+ componentType : type . name ,
856
+ } as DeployMessage ,
857
+ ] ,
858
+ } ,
859
+ } ;
860
+ const result = new DeployResult ( apiStatus as MetadataApiDeployStatus , deployedSet ) ;
861
+
862
+ const responses = result . getFileResponses ( ) ;
863
+ const expected : FileResponse [ ] = [
864
+ {
865
+ fullName,
866
+ type : type . name ,
867
+ state : ComponentStatus . Failed ,
868
+ filePath : content ,
869
+ error : `${ problem } (3:5)` ,
870
+ lineNumber : 3 ,
871
+ columnNumber : 5 ,
872
+ problemType,
873
+ } ,
874
+ ] ;
875
+
876
+ expect ( responses ) . to . deep . equal ( expected ) ;
877
+ } ) ;
878
+
822
879
it ( 'should report children of deployed component' , ( ) => {
823
880
const component = DECOMPOSED_COMPONENT ;
824
881
const deployedSet = new ComponentSet ( [ component ] ) ;
0 commit comments