aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2/pages/workspace/attributes/attributes-modal.component.spec.ts
diff options
context:
space:
mode:
authoraribeiro <anderson.ribeiro@est.tech>2020-11-17 10:52:41 +0000
committerS�bastien Determe <sebastien.determe@intl.att.com>2020-11-17 16:01:54 +0000
commit5eb632de67f90a92e3032f97da1dcc25d53e8110 (patch)
treed1b504d09cb517dd614c344f83a21a68f771c882 /catalog-ui/src/app/ng2/pages/workspace/attributes/attributes-modal.component.spec.ts
parent8adf8aa4772b282133e053a21fc8de65973d37e5 (diff)
Fix import VFC with attributes1.7.3
Fix import VFC with default attribute value Fix Update, create and delete attribute action Make attribute definition tosca compliant Issue-ID: SDC-3381 Signed-off-by: aribeiro <anderson.ribeiro@est.tech> Change-Id: Ibbd36b105b8c86d1e750f3b6d55752d63fe6530e (cherry picked from commit 2f74a4ac81f228bdb0bf0f509e9c0ef296d28d82)
Diffstat (limited to 'catalog-ui/src/app/ng2/pages/workspace/attributes/attributes-modal.component.spec.ts')
-rw-r--r--catalog-ui/src/app/ng2/pages/workspace/attributes/attributes-modal.component.spec.ts20
1 files changed, 5 insertions, 15 deletions
diff --git a/catalog-ui/src/app/ng2/pages/workspace/attributes/attributes-modal.component.spec.ts b/catalog-ui/src/app/ng2/pages/workspace/attributes/attributes-modal.component.spec.ts
index 99aa140dd1..2eed2311bb 100644
--- a/catalog-ui/src/app/ng2/pages/workspace/attributes/attributes-modal.component.spec.ts
+++ b/catalog-ui/src/app/ng2/pages/workspace/attributes/attributes-modal.component.spec.ts
@@ -56,28 +56,18 @@ describe('attributes modal component', () => {
})
);
- it('test that when hidden is clicked, hidden attribute is set', async () => {
- fixture.componentInstance.attributeToEdit = new AttributeModel();
- const hidden = fixture.componentInstance.attributeToEdit.hidden;
- fixture.componentInstance.ngOnInit();
-
- expect(hidden).toBe(false);
- fixture.componentInstance.onHiddenCheckboxClicked(true);
- expect(fixture.componentInstance.attributeToEdit.hidden).toBe(true);
- });
-
it('test that when type is set to boolean default value is cleared', async () => {
const component = fixture.componentInstance;
component.attributeToEdit = new AttributeModel();
component.ngOnInit();
component.onTypeSelected({ value : 'string', label : 'string'});
- component.attributeToEdit.defaultValue = 'some_value';
+ component.attributeToEdit._default = 'some_value';
component.onTypeSelected({ value : 'boolean', label : 'boolean'});
- expect(component.attributeToEdit.defaultValue).toBe('');
+ expect(component.attributeToEdit._default).toBe('');
component.onBooleanDefaultValueSelected({ value : 'true', label : 'true'});
- expect(component.attributeToEdit.defaultValue).toBe('true');
+ expect(component.attributeToEdit._default).toBe('true');
});
it('test that when certain type is selected, the correct regex pattern is chosen', async () => {
@@ -120,9 +110,9 @@ describe('attributes modal component', () => {
expect(component.isMapUnique()).toBe(true); // map is not selected so return true by default
component.onTypeSelected({ value : 'map', label : 'map'});
component.onEntrySchemaTypeSelected({ value : 'boolean', label : 'boolean' });
- component.attributeToEdit.defaultValue = '"1":true,"2":false';
+ component.attributeToEdit._default = '"1":true,"2":false';
expect(component.isMapUnique()).toBe(true);
- component.attributeToEdit.defaultValue = '"1":true,"1":false';
+ component.attributeToEdit._default = '"1":true,"1":false';
expect(component.isMapUnique()).toBe(false);
});
});