From 1a3742cc07327214adcd3052d174254331d92073 Mon Sep 17 00:00:00 2001 From: Indrijeet kumar Date: Thu, 2 Apr 2020 11:53:21 +0530 Subject: test cases written in new-menu component test cases written in new-menu component Issue-ID: PORTAL-813 Change-Id: I71368b07ff44a758e17ddc16ef7532a6abfa7d7c Signed-off-by: Indrijeet Kumar --- .../admin/menus/new-menu/new-menu.component.spec.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp') diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/new-menu/new-menu.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/new-menu/new-menu.component.spec.ts index 5c22346e..1c08a97a 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/new-menu/new-menu.component.spec.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/new-menu/new-menu.component.spec.ts @@ -46,10 +46,13 @@ import { HttpClientTestingModule } from '@angular/common/http/testing'; import { NgbActiveModal, NgbModalModule } from '@ng-bootstrap/ng-bootstrap'; import { RouterTestingModule } from '@angular/router/testing'; import { CookieService } from 'ngx-cookie-service'; +import { MockBackend } from '@angular/http/testing'; +import { BaseRequestOptions, Http } from '@angular/http'; import { AdminService } from '../../admin.service'; import 'rxjs/add/operator/toPromise'; import { ConfirmationModalComponent } from 'src/app/modals/confirmation-modal/confirmation-modal.component'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { MaterialModule } from 'portalsdk-tag-lib/material-module'; import 'rxjs/add/observable/of'; import { Observable } from 'rxjs/Observable'; import 'rxjs/add/operator/catch'; @@ -61,6 +64,7 @@ describe('NewMenuComponent', () => { let component: NewMenuComponent; let fixture: ComponentFixture; let adminService:AdminService; + // let entryComponents:any; beforeEach(async(() => { TestBed.configureTestingModule({ @@ -128,6 +132,13 @@ describe('NewMenuComponent', () => { expect(spy).toHaveBeenCalled(); }) + it('should test getParentData method2 error part ',()=>{ + const children="children"; + let spy=spyOn(adminService,'getParentData').and.returnValue(Observable.throw({status:404})); + component.getParentData(); + expect(spy).toHaveBeenCalled(); + }) + describe('should test getLeftMenuItems',()=>{ it('testing getLeftMenuItems',()=>{ component.getLeftMenuItems(); @@ -140,6 +151,14 @@ describe('NewMenuComponent', () => { expect(spy).toHaveBeenCalled(); }) + describe('should test getFunctionCDselectData method2',()=>{ + it('testing getFunctionCDselectData',()=>{ + let spy= spyOn(adminService,'getFunctionCdList').and.returnValue(Observable.throw({status:404})) + component.getFunctionCDselectData(); + expect(spy).toHaveBeenCalled(); + }) + }) + it('should test updateFnMenu method',()=>{ component.menu.label!=null; component.updateFnMenu(); -- cgit 1.2.3-korg id' value='dc856bba284798fa8f1484abf8fc8140008ececb'/>
blob: 5ab14588921d6a233ae12f64a1c8d1fbf79d11ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71