aboutsummaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/shared/utils
diff options
context:
space:
mode:
Diffstat (limited to 'vid-webpack-master/src/app/shared/utils')
-rw-r--r--vid-webpack-master/src/app/shared/utils/util.spec.ts12
-rw-r--r--vid-webpack-master/src/app/shared/utils/utils.ts4
2 files changed, 16 insertions, 0 deletions
diff --git a/vid-webpack-master/src/app/shared/utils/util.spec.ts b/vid-webpack-master/src/app/shared/utils/util.spec.ts
index 2f9142f9c..4b39764f5 100644
--- a/vid-webpack-master/src/app/shared/utils/util.spec.ts
+++ b/vid-webpack-master/src/app/shared/utils/util.spec.ts
@@ -1,5 +1,6 @@
import {Utils} from "./utils";
import {TestBed} from "@angular/core/testing";
+import each from "jest-each";
describe('Util', () => {
@@ -28,4 +29,15 @@ describe('Util', () => {
test('hasContents should return true if object is not undefined and not null and not empty', () => {
expect(Utils.hasContents("someValue")).toBeTruthy();
});
+
+ const instantiationTypesDataProvider = [
+ ['Macro', false ],
+ ['ALaCarte', true ],
+ ['ClientConfig', true],
+ ['dont know', true]
+ ];
+ each(instantiationTypesDataProvider).test('instantiationType %s isALaCarte shall be %s', (instantiationType, expected ) => {
+ expect(Utils.isALaCarte(instantiationType)).toEqual(expected);
+ });
+
});
diff --git a/vid-webpack-master/src/app/shared/utils/utils.ts b/vid-webpack-master/src/app/shared/utils/utils.ts
index d63a3c997..cb5e1a1c8 100644
--- a/vid-webpack-master/src/app/shared/utils/utils.ts
+++ b/vid-webpack-master/src/app/shared/utils/utils.ts
@@ -179,6 +179,10 @@ export class Utils {
return (convertedAsdcModel);
};
+ public static isALaCarte(instantiationType) {
+ return instantiationType !== 'Macro';
+ }
+
private static convertOldModel(serviceModel ) {
let resource = {};
let convertedAsdcModel = {