blob: a998cb0cf6c9106e6378f5078dbd39db064e5e0b [file] [log] [blame]
Sean Condon49e15be2018-05-16 16:58:29 +01001/*
2 * Copyright 2018-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
Sean Condon83fc39f2018-04-19 18:56:13 +010016import { async, ComponentFixture, TestBed } from '@angular/core/testing';
17
Sean Condon49e15be2018-05-16 16:58:29 +010018import { LogService } from '../../../../app/log.service';
19import { ConsoleLoggerService } from '../../../../app/consolelogger.service';
Sean Condon83fc39f2018-04-19 18:56:13 +010020import { AppsComponent } from '../../../../app/view/apps/apps.component';
Sean Condon49e15be2018-05-16 16:58:29 +010021import { DialogService } from '../../../../app/fw/layer/dialog.service';
22import { FnService } from '../../../../app/fw/util/fn.service';
23import { IconService } from '../../../../app/fw/svg/icon.service';
24import { KeyService } from '../../../../app/fw/util/key.service';
25import { LionService } from '../../../../app/fw/util/lion.service';
26import { PanelService } from '../../../../app/fw/layer/panel.service';
27import { TableBuilderService } from '../../../../app/fw/widget/tablebuilder.service';
28import { UrlFnService } from '../../../../app/fw/remote/urlfn.service';
29import { WebSocketService } from '../../../../app/fw/remote/websocket.service';
Sean Condon83fc39f2018-04-19 18:56:13 +010030
Sean Condon49e15be2018-05-16 16:58:29 +010031class MockDialogService {}
32
33class MockFnService {}
34
35class MockIconService {}
36
37class MockKeyService {}
38
39class MockLionService {}
40
41class MockPanelService {}
42
43class MockTableBuilderService {}
44
45class MockUrlFnService {}
46
47class MockWebSocketService {}
48
49/**
50 * ONOS GUI -- Apps View -- Unit Tests
51 */
Sean Condon83fc39f2018-04-19 18:56:13 +010052describe('AppsComponent', () => {
Sean Condon49e15be2018-05-16 16:58:29 +010053 let log: LogService;
54 let component: AppsComponent;
55 let fixture: ComponentFixture<AppsComponent>;
56 const windowMock = <any>{ location: <any> { hostname: 'localhost' } };
Sean Condon83fc39f2018-04-19 18:56:13 +010057
Sean Condon49e15be2018-05-16 16:58:29 +010058 beforeEach(async(() => {
59 log = new ConsoleLoggerService();
Sean Condon83fc39f2018-04-19 18:56:13 +010060
Sean Condon49e15be2018-05-16 16:58:29 +010061 TestBed.configureTestingModule({
62 declarations: [ AppsComponent ],
63 providers: [
64 { provide: DialogService, useClass: MockDialogService },
65 { provide: FnService, useClass: MockFnService },
66 { provide: IconService, useClass: MockIconService },
67 { provide: KeyService, useClass: MockKeyService },
68 { provide: LionService, useClass: MockLionService },
69 { provide: LogService, useValue: log },
70 { provide: PanelService, useClass: MockPanelService },
71 { provide: TableBuilderService, useClass: MockTableBuilderService },
72 { provide: UrlFnService, useClass: MockUrlFnService },
73 { provide: WebSocketService, useClass: MockWebSocketService },
74 { provide: Window, useValue: windowMock },
75 ]
76 })
77 .compileComponents();
78 }));
Sean Condon83fc39f2018-04-19 18:56:13 +010079
Sean Condon49e15be2018-05-16 16:58:29 +010080 beforeEach(() => {
81 fixture = TestBed.createComponent(AppsComponent);
82 component = fixture.componentInstance;
83 fixture.detectChanges();
84 });
85
86 it('should create', () => {
87 expect(component).toBeTruthy();
88 });
Sean Condon83fc39f2018-04-19 18:56:13 +010089});