Added app, tests, lint to BUCK file for web/gui2
Change-Id: I94912cb18f31db26971b66c9d851fb57f022df54
diff --git a/web/gui2/src/main/webapp/tests/app/fw/mast/mast.service.spec.ts b/web/gui2/src/main/webapp/tests/app/fw/mast/mast.service.spec.ts
index 58eba10..5c00e67 100644
--- a/web/gui2/src/main/webapp/tests/app/fw/mast/mast.service.spec.ts
+++ b/web/gui2/src/main/webapp/tests/app/fw/mast/mast.service.spec.ts
@@ -16,18 +16,32 @@
import { TestBed, inject } from '@angular/core/testing';
import { MastService } from '../../../../app/fw/mast/mast.service';
+import { LogService } from '../../../../app/log.service';
+import { ConsoleLoggerService } from '../../../../app/consolelogger.service';
+import { FnService } from '../../../../app/fw/util/fn.service';
+
+class MockFnService {
+ isMobile() {}
+}
/**
* ONOS GUI -- Masthead Service - Unit Tests
*/
describe('MastService', () => {
- beforeEach(() => {
- TestBed.configureTestingModule({
- providers: [MastService]
- });
- });
+ let log: LogService;
- it('should be created', inject([MastService], (service: MastService) => {
- expect(service).toBeTruthy();
- }));
+ beforeEach(() => {
+ log = new ConsoleLoggerService();
+
+ TestBed.configureTestingModule({
+ providers: [MastService,
+ { provide: FnService, useClass: MockFnService },
+ { provide: LogService, useValue: log },
+ ]
+ });
+ });
+
+ it('should be created', inject([MastService], (service: MastService) => {
+ expect(service).toBeTruthy();
+ }));
});
diff --git a/web/gui2/src/main/webapp/tests/app/fw/mast/mast/mast.component.spec.ts b/web/gui2/src/main/webapp/tests/app/fw/mast/mast/mast.component.spec.ts
index 94f0f16..fe97527 100644
--- a/web/gui2/src/main/webapp/tests/app/fw/mast/mast/mast.component.spec.ts
+++ b/web/gui2/src/main/webapp/tests/app/fw/mast/mast/mast.component.spec.ts
@@ -15,29 +15,50 @@
*/
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+import { LogService } from '../../../../../app/log.service';
+import { ConsoleLoggerService } from '../../../../../app/consolelogger.service';
import { MastComponent } from '../../../../../app/fw/mast/mast/mast.component';
+import { IconComponent } from '../../../../../app/fw/svg/icon/icon.component';
+import { DialogService } from '../../../../../app/fw/layer/dialog.service';
+import { LionService } from '../../../../../app/fw/util/lion.service';
+import { IconService } from '../../../../../app/fw/svg/icon.service';
+import { NavService } from '../../../../../app/fw/nav/nav.service';
+import { WebSocketService } from '../../../../../app/fw/remote/websocket.service';
+
+class MockDialogService {}
+
+class MockLionService {}
+
+class MockNavService {}
+
+class MockWebSocketService {}
+
+class MockIconService {}
/**
* ONOS GUI -- Masthead Controller - Unit Tests
*/
describe('MastComponent', () => {
- let component: MastComponent;
- let fixture: ComponentFixture<MastComponent>;
+ let log: LogService;
- beforeEach(async(() => {
- TestBed.configureTestingModule({
- declarations: [ MastComponent ]
- })
- .compileComponents();
- }));
+ beforeEach(() => {
+ log = new ConsoleLoggerService();
+ TestBed.configureTestingModule({
+ declarations: [ MastComponent, IconComponent ],
+ providers: [
+ { provide: DialogService, useClass: MockDialogService },
+ { provide: LionService, useClass: MockLionService },
+ { provide: LogService, useValue: log },
+ { provide: NavService, useClass: MockNavService },
+ { provide: WebSocketService, useClass: MockWebSocketService },
+ { provide: IconService, useClass: MockIconService },
+ ]
+ });
+ });
- beforeEach(() => {
- fixture = TestBed.createComponent(MastComponent);
- component = fixture.componentInstance;
- fixture.detectChanges();
- });
-
- it('should create', () => {
- expect(component).toBeTruthy();
- });
+ it('should create', () => {
+ const fixture = TestBed.createComponent(MastComponent);
+ const component = fixture.componentInstance;
+ expect(component).toBeTruthy();
+ });
});