Test cases - build-artifacts component 97/58197/3
authorArundathi Patil <arundpil@in.ibm.com>
Tue, 31 Jul 2018 09:08:10 +0000 (14:38 +0530)
committerTakamune Cho <tc012c@att.com>
Thu, 2 Aug 2018 19:54:19 +0000 (19:54 +0000)
Wrote test cases to cover updateAccessUpdatePages method in
build-artifacts component.

Issue-ID: APPC-1064
Change-Id: If654c89d1daf1d9639aa172c08f3270b6337ba0e
Signed-off-by: Arundathi Patil <arundpil@in.ibm.com>
src/app/vnfs/build-artifacts/build-artifacts.component.spec.ts

index a1b4507..a6ba8c3 100644 (file)
@@ -2,6 +2,8 @@
 ============LICENSE_START==========================================
 ===================================================================
 Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
+
+Modification Copyright (C) 2018 IBM.
 ===================================================================
 
 Unless otherwise specified, all software contained herein is licensed
@@ -145,4 +147,16 @@ describe('BuildDesignComponent', () => {
 
         expect(spy).toHaveBeenCalled();
     });
+
+    it('Should test updateAccessUpdatePages method to call setAllowOtherUpdates with true', ()=> {
+        spyOn(component, 'setAllowOtherUpdates');        
+        component.updateAccessUpdatePages('config', [{'action' : 'configModify'}, {'action' : 'config'}]);
+        expect(component.setAllowOtherUpdates).toHaveBeenCalledWith(true);
+    });
+
+    it('Should test updateAccessUpdatePages method to call setAllowOtherUpdates with fasle', ()=> {
+        spyOn(component, 'setAllowOtherUpdates');        
+        component.updateAccessUpdatePages('config', [{'action' : 'configModify'}]);
+        expect(component.setAllowOtherUpdates).toHaveBeenCalledWith(false);
+    });
 });