test case written for layout component 99/102199/1
authorIndrijeet kumar <indriku1@in.ibm.com>
Mon, 24 Feb 2020 07:10:14 +0000 (12:40 +0530)
committerIndrijeet kumar <indriku1@in.ibm.com>
Mon, 24 Feb 2020 07:10:23 +0000 (12:40 +0530)
test case written for layout component

Issue-ID: PORTAL-813
Change-Id: If783ae282496c320afeb8eb25038f8991f8cee3b
Signed-off-by: Indrijeet Kumar <indriku1@in.ibm.com>
ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/layout.component.spec.ts

index 13d3e34..6a2bb7f 100644 (file)
@@ -41,6 +41,9 @@ import { TranslateModule } from '@ngx-translate/core';
 import { HttpClientTestingModule } from '@angular/common/http/testing';
 import { LayoutComponent } from './layout.component';
 import { LayoutModule } from './layout.module';
+import { MatDialog, MatDialogModule } from '@angular/material';
+import { Overlay } from '@angular/cdk/overlay';
+import { CookieService } from 'ngx-cookie-service';
 
 describe('LayoutComponent', () => {
   let component: LayoutComponent;
@@ -48,13 +51,14 @@ describe('LayoutComponent', () => {
 
   beforeEach( async(() => {
       TestBed.configureTestingModule({
-        providers:[],
+        providers:[CookieService],
         imports: [
+          MatDialogModule,
           HttpClientTestingModule,
           LayoutModule,
           RouterTestingModule,
           TranslateModule.forRoot(),
-        ]
+        ],
       }).compileComponents();
     })
   );
@@ -68,4 +72,10 @@ describe('LayoutComponent', () => {
   it('should create', () => {
     expect(component).toBeTruthy();
   });
+
+  it('should test receiveCollapsed method',()=>{
+    component.receiveCollapsed(true);
+    expect(component.collapedSideBar).toBe(true);
+  })
+
 });