summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/jest/mocks/req-and-capabilities.mock.ts
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-ui/src/jest/mocks/req-and-capabilities.mock.ts')
-rw-r--r--catalog-ui/src/jest/mocks/req-and-capabilities.mock.ts30
1 files changed, 30 insertions, 0 deletions
diff --git a/catalog-ui/src/jest/mocks/req-and-capabilities.mock.ts b/catalog-ui/src/jest/mocks/req-and-capabilities.mock.ts
new file mode 100644
index 0000000000..467f00d491
--- /dev/null
+++ b/catalog-ui/src/jest/mocks/req-and-capabilities.mock.ts
@@ -0,0 +1,30 @@
+import {Requirement} from "../../app/models/requirement";
+
+export const requirementMock = [
+ {"name": "dependency", "capability": "tosca.capabilities.Node", "node": "tosca.nodes.Root", "relationship": "tosca.relationships.DependsOn", "minOccurrences": "0", "maxOccurrences": "UNBOUNDED"},
+ {"name": "binding", "capability": "tosca.capabilities.network.Bindable", "node": null, "relationship": "tosca.relationships.network.BindsTo", "minOccurrences": "1", "maxOccurrences": "UNBOUNDED"},
+ {"name": "link", "capability": "tosca.capabilities.network.Linkable", "node": null, "relationship": "tosca.relationships.network.LinksTo", "minOccurrences": "1", "maxOccurrences": "UNBOUNDED"}
+];
+
+export const capabilitiesMock = [
+ {"name": "attachment", "type": "tosca.capabilities.Attachment", "validSourceTypes": ["firstSource", "secondSource"], "minOccurrences": "0", "maxOccurrences": "UNBOUNDED"},
+ {"name": "binding", "type": "tosca.capabilities.Node", "validSourceTypes": ["1source"], "minOccurrences": "1", "maxOccurrences": "UNBOUNDED"}
+];
+
+const requirement1: Requirement = new Requirement();
+requirement1.name = "dependency";
+requirement1.capability = "tosca.capabilities.Node";
+requirement1.node = "tosca.nodes.Root";
+requirement1.relationship = "tosca.relationships.DependsOn";
+requirement1.minOccurrences = "0";
+requirement1.maxOccurrences = "UNBOUNDED";
+const requirement2: Requirement = new Requirement();
+requirement2.name = "binding";
+requirement2.capability = "tosca.capabilities.network.Bindable";
+requirement2.node = null;
+requirement2.relationship = "tosca.relationships.network.BindsTo";
+requirement2.minOccurrences = "1";
+requirement2.maxOccurrences = "UNBOUNDED";
+export const filterRequirmentsMock: Array<Requirement> = [requirement1, requirement2];
+
+