Fixing SO-Monitoring UI tests
[so.git] / so-monitoring / so-monitoring-ui / src / main / frontend / src / app / app.component.spec.ts
index 076be17..cb5f53b 100644 (file)
@@ -23,6 +23,8 @@ SPDX-License-Identifier: Apache-2.0
 import { TestBed, async } from '@angular/core/testing';\r
 import { RouterTestingModule } from '@angular/router/testing';\r
 import { AppComponent } from './app.component';\r
+import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';\r
+\r
 describe('AppComponent', () => {\r
   beforeEach(async(() => {\r
     TestBed.configureTestingModule({\r
@@ -32,22 +34,24 @@ describe('AppComponent', () => {
       declarations: [\r
         AppComponent\r
       ],\r
+      schemas: [\r
+        CUSTOM_ELEMENTS_SCHEMA\r
+      ],\r
     }).compileComponents();\r
   }));\r
-  it('should create the app', async(() => {\r
+\r
+  // Ensure creation of SO Monitoring application\r
+  it('application should be created', async(() => {\r
     const fixture = TestBed.createComponent(AppComponent);\r
     const app = fixture.debugElement.componentInstance;\r
     expect(app).toBeTruthy();\r
   }));\r
-  it(`should have as title 'app'`, async(() => {\r
+\r
+\r
+  // Ensure application title is "SO Monitor"\r
+  it(`should have title 'SO Monitor'`, async(() => {\r
     const fixture = TestBed.createComponent(AppComponent);\r
     const app = fixture.debugElement.componentInstance;\r
-    expect(app.title).toEqual('app');\r
-  }));\r
-  it('should render title in a h1 tag', async(() => {\r
-    const fixture = TestBed.createComponent(AppComponent);\r
-    fixture.detectChanges();\r
-    const compiled = fixture.debugElement.nativeElement;\r
-    expect(compiled.querySelector('h1').textContent).toContain('Welcome to ONAP-SO-Monitor!');\r
+    expect(app.title).toEqual('SO Monitor');\r
   }));\r
 });\r