userlogin-form component test case 03/94903/2
authorArundathi Patil <arundpil@in.ibm.com>
Wed, 4 Sep 2019 09:14:41 +0000 (14:44 +0530)
committerTakamune Cho <takamune.cho@att.com>
Fri, 6 Sep 2019 17:51:27 +0000 (17:51 +0000)
Added test case to test ValidateUserName function

Issue-ID: APPC-1632
Change-Id: Ib719952a698672ba0ffa99b2a71a1ebb1e55208f
Signed-off-by: Arundathi Patil <arundpil@in.ibm.com>
src/app/vnfs/userlogin-form/userlogin-form.component.spec.ts

index ea97439..712d1bf 100644 (file)
@@ -102,5 +102,12 @@ describe('userloginFormComponent', () => {
         expect(localStorage['userId']).toBe('test Usr');
     }));
 
+    it('test validateUserName function', () => {
+        component.userId = '';
+        component.validateUserName();
+        expect(component.errorMessage).toEqual('');
+        expect(component.invalid).toEqual(true);
+    });
+
 });