2 * ========================LICENSE_START=================================
5 * Copyright (C) 2019 AT&T Intellectual Property
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ========================LICENSE_END===================================
20 import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
21 import { TestBed, async, ComponentFixture } from '@angular/core/testing';
22 import { RouterTestingModule } from '@angular/router/testing';
23 import { CookieService } from 'ngx-cookie';
24 import { AppComponent } from './app.component';
25 import { UiService } from './services/ui/ui.service';
27 describe('AppComponent', () => {
28 let fixture: ComponentFixture<AppComponent>;
30 beforeEach(async(() => {
31 const cookieSpy = jasmine.createSpyObj('CookieService', [ 'get' ]);
32 TestBed.configureTestingModule({
37 CUSTOM_ELEMENTS_SCHEMA
43 { provide: CookieService, useValue: cookieSpy },
46 }).compileComponents();
50 fixture = TestBed.createComponent(AppComponent);
51 fixture.detectChanges();
54 it('should create the app', () => {
55 const app = fixture.componentInstance;
56 expect(app).toBeTruthy();
59 describe('#content', () => {
60 it('should contain oran logo', async(() => {
61 const ele = fixture.debugElement.nativeElement.querySelector('img');
62 expect(ele.src).toContain('assets/oran-logo.png');
65 it('should contain heading', async(() => {
66 const ele = fixture.debugElement.nativeElement.querySelector('tspan');
67 expect(ele.textContent.trim()).toBe('Non-RT RIC Control Panel');
70 it('should contain router-outlet', async(() => {
71 const ele = fixture.debugElement.nativeElement.querySelector('router-outlet');
72 expect(ele).toBeTruthy();
75 it('should contain nrcp-footer', async(() => {
76 const ele = fixture.debugElement.nativeElement.querySelector('nrcp-footer');
77 expect(ele).toBeTruthy();