@@ -422,6 +422,38 @@ test.serial("default manifest creation with special characters small app descrip
422
422
t . is ( await result . getString ( ) , expectedManifestContentSmallVersionString , "Correct result returned" ) ;
423
423
} ) ;
424
424
425
+ test . serial ( "default manifest creation with special characters very small app descriptor version" , async ( t ) => {
426
+ const { manifestCreator, errorLogStub} = t . context ;
427
+ const prefix = "/resources/sap/ui/mine/" ;
428
+ const libraryResource = {
429
+ getPath : ( ) => {
430
+ return prefix + ".library" ;
431
+ } ,
432
+ getString : async ( ) => {
433
+ return libraryContent ;
434
+ } ,
435
+ _project : {
436
+ dependencies : [ {
437
+ metadata : {
438
+ name : "sap.ui.core"
439
+ }
440
+ } ]
441
+ }
442
+ } ;
443
+ t . is ( errorLogStub . callCount , 0 ) ;
444
+
445
+ const options = { descriptorVersion : new Version ( "1.1.0" ) } ;
446
+ const result = await manifestCreator ( { libraryResource, resources : [ ] , options} ) ;
447
+ const expectedManifestContentSmallVersion = expectedManifestContentObject ( ) ;
448
+ expectedManifestContentSmallVersion [ "_version" ] = "1.1.0" ;
449
+ expectedManifestContentSmallVersion [ "sap.app" ] [ "_version" ] = "1.2.0" ;
450
+ expectedManifestContentSmallVersion [ "sap.ui" ] [ "_version" ] = "1.1.0" ;
451
+ expectedManifestContentSmallVersion [ "sap.ui5" ] [ "_version" ] = "1.1.0" ;
452
+ expectedManifestContentSmallVersion [ "sap.app" ] [ "i18n" ] = "i18n/i18n.properties" ;
453
+ const sResult = await result . getString ( ) ;
454
+ t . deepEqual ( JSON . parse ( sResult ) , expectedManifestContentSmallVersion , "Correct result returned" ) ;
455
+ } ) ;
456
+
425
457
test . serial ( "manifest creation for sap/apf" , async ( t ) => {
426
458
const { manifestCreator, errorLogStub, verboseLogStub} = t . context ;
427
459
@@ -696,7 +728,7 @@ test.serial("manifest creation with embedded component", async (t) => {
696
728
"checking component at %s" , "/resources/sap/lib1/component1"
697
729
] ) ;
698
730
t . deepEqual ( verboseLogStub . getCall ( 1 ) . args , [
699
- " component's ' sap.app/embeddedBy' property points to library, list it as 'embedded' "
731
+ " sap.app/id taken from . library: '%s'" , "sap.lib1 "
700
732
] ) ;
701
733
} ) ;
702
734
@@ -708,7 +740,9 @@ test.serial("manifest creation with embedded component (Missing 'embeddedBy')",
708
740
"sap.app" : {
709
741
"id" : "sap.lib1" ,
710
742
"type" : "library" ,
711
- "embeds" : [ ] ,
743
+ "embeds" : [
744
+ "component1"
745
+ ] ,
712
746
"applicationVersion" : {
713
747
"version" : "1.0.0"
714
748
} ,
@@ -780,7 +814,7 @@ test.serial("manifest creation with embedded component (Missing 'embeddedBy')",
780
814
"checking component at %s" , "/resources/sap/lib1/component1"
781
815
] ) ;
782
816
t . deepEqual ( verboseLogStub . getCall ( 1 ) . args , [
783
- " component doesn't declare ' sap.app/embeddedBy', don't list it as 'embedded' "
817
+ " sap.app/id taken from .library: '%s'" , "sap.lib1 "
784
818
] ) ;
785
819
} ) ;
786
820
@@ -792,7 +826,9 @@ test.serial("manifest creation with embedded component ('embeddedBy' doesn't poi
792
826
"sap.app" : {
793
827
"id" : "sap.lib1" ,
794
828
"type" : "library" ,
795
- "embeds" : [ ] ,
829
+ "embeds" : [
830
+ "component1"
831
+ ] ,
796
832
"applicationVersion" : {
797
833
"version" : "1.0.0"
798
834
} ,
@@ -868,8 +904,7 @@ test.serial("manifest creation with embedded component ('embeddedBy' doesn't poi
868
904
"checking component at %s" , "/resources/sap/lib1/component1"
869
905
] ) ;
870
906
t . deepEqual ( verboseLogStub . getCall ( 1 ) . args , [
871
- " component's 'sap.app/embeddedBy' points to '%s', don't list it as 'embedded'" ,
872
- "/resources/sap/lib1/foo/"
907
+ " sap.app/id taken from .library: '%s'" , "sap.lib1"
873
908
] ) ;
874
909
} ) ;
875
910
@@ -881,7 +916,9 @@ test.serial("manifest creation with embedded component ('embeddedBy' absolute pa
881
916
"sap.app" : {
882
917
"id" : "sap.lib1" ,
883
918
"type" : "library" ,
884
- "embeds" : [ ] ,
919
+ "embeds" : [
920
+ "component1"
921
+ ] ,
885
922
"applicationVersion" : {
886
923
"version" : "1.0.0"
887
924
} ,
@@ -957,8 +994,7 @@ test.serial("manifest creation with embedded component ('embeddedBy' absolute pa
957
994
"checking component at %s" , "/resources/sap/lib1/component1"
958
995
] ) ;
959
996
t . deepEqual ( verboseLogStub . getCall ( 1 ) . args , [
960
- " component's 'sap.app/embeddedBy' points to '%s', don't list it as 'embedded'" ,
961
- "/"
997
+ " sap.app/id taken from .library: '%s'" , "sap.lib1"
962
998
] ) ;
963
999
} ) ;
964
1000
@@ -970,7 +1006,9 @@ test.serial("manifest creation with embedded component ('embeddedBy' empty strin
970
1006
"sap.app" : {
971
1007
"id" : "sap.lib1" ,
972
1008
"type" : "library" ,
973
- "embeds" : [ ] ,
1009
+ "embeds" : [
1010
+ "component1"
1011
+ ] ,
974
1012
"applicationVersion" : {
975
1013
"version" : "1.0.0"
976
1014
} ,
@@ -1039,12 +1077,7 @@ test.serial("manifest creation with embedded component ('embeddedBy' empty strin
1039
1077
} ) ;
1040
1078
t . is ( await result . getString ( ) , expectedManifestContent , "Correct result returned" ) ;
1041
1079
1042
- t . is ( errorLogStub . callCount , 1 ) ;
1043
- t . deepEqual ( errorLogStub . getCall ( 0 ) . args , [
1044
- " component '%s': property 'sap.app/embeddedBy' has an empty string value (which is invalid), " +
1045
- "it won't be listed as 'embedded'" ,
1046
- "/resources/sap/lib1/component1"
1047
- ] ) ;
1080
+ t . is ( errorLogStub . callCount , 0 ) ;
1048
1081
} ) ;
1049
1082
1050
1083
test . serial ( "manifest creation with embedded component ('embeddedBy' object)" , async ( t ) => {
@@ -1055,7 +1088,9 @@ test.serial("manifest creation with embedded component ('embeddedBy' object)", a
1055
1088
"sap.app" : {
1056
1089
"id" : "sap.lib1" ,
1057
1090
"type" : "library" ,
1058
- "embeds" : [ ] ,
1091
+ "embeds" : [
1092
+ "component1"
1093
+ ] ,
1059
1094
"applicationVersion" : {
1060
1095
"version" : "1.0.0"
1061
1096
} ,
@@ -1126,13 +1161,7 @@ test.serial("manifest creation with embedded component ('embeddedBy' object)", a
1126
1161
} ) ;
1127
1162
t . is ( await result . getString ( ) , expectedManifestContent , "Correct result returned" ) ;
1128
1163
1129
- t . is ( errorLogStub . callCount , 1 ) ;
1130
- t . deepEqual ( errorLogStub . getCall ( 0 ) . args , [
1131
- " component '%s': property 'sap.app/embeddedBy' is of type '%s' (expected 'string'), " +
1132
- "it won't be listed as 'embedded'" ,
1133
- "/resources/sap/lib1/component1" ,
1134
- "object"
1135
- ] ) ;
1164
+ t . is ( errorLogStub . callCount , 0 ) ;
1136
1165
} ) ;
1137
1166
1138
1167
test . serial ( "manifest creation with embedded component (no manifest.json)" , async ( t ) => {
@@ -1219,7 +1248,9 @@ test.serial("manifest creation with embedded component (invalid manifest.json)",
1219
1248
"sap.app" : {
1220
1249
"id" : "sap.lib1" ,
1221
1250
"type" : "library" ,
1222
- "embeds" : [ ] ,
1251
+ "embeds" : [
1252
+ "component1"
1253
+ ] ,
1223
1254
"applicationVersion" : {
1224
1255
"version" : "1.0.0"
1225
1256
} ,
@@ -1284,15 +1315,7 @@ test.serial("manifest creation with embedded component (invalid manifest.json)",
1284
1315
} ) ;
1285
1316
t . is ( await result . getString ( ) , expectedManifestContent , "Correct result returned" ) ;
1286
1317
1287
- t . is ( errorLogStub . callCount , 1 ) ;
1288
- t . is ( errorLogStub . getCall ( 0 ) . args . length , 3 ) ;
1289
- t . deepEqual ( errorLogStub . getCall ( 0 ) . args . slice ( 0 , 2 ) , [
1290
- " component '%s': failed to read the component's manifest.json, " +
1291
- "it won't be listed as 'embedded'.\n" +
1292
- "Error details: %s" ,
1293
- "/resources/sap/lib1/component1"
1294
- ] ) ;
1295
- t . true ( errorLogStub . getCall ( 0 ) . args [ 2 ] . startsWith ( "SyntaxError: Unexpected token" ) ) ;
1318
+ t . is ( errorLogStub . callCount , 0 ) ;
1296
1319
} ) ;
1297
1320
1298
1321
test . serial ( "manifest creation for invalid .library content" , async ( t ) => {
0 commit comments