blob: 4c5c25287d75fa974fca4d8424c9fcd6c48979fd [file] [log] [blame]
Sean Condon83fc39f2018-04-19 18:56:13 +01001/*
2 * Copyright 2016-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 Condon49e15be2018-05-16 16:58:29 +010016import { TestBed, inject } from '@angular/core/testing';
17
18import { ElementRef } from '@angular/core';
Sean Condon83fc39f2018-04-19 18:56:13 +010019import { LogService } from '../../../../app/log.service';
Sean Condon49e15be2018-05-16 16:58:29 +010020import { ConsoleLoggerService } from '../../../../app/consolelogger.service';
21import { IconDirective } from '../../../../app/fw/svg/icon.directive';
Sean Condon83fc39f2018-04-19 18:56:13 +010022import { IconService } from '../../../../app/fw/svg/icon.service';
23import { GlyphService } from '../../../../app/fw/svg/glyph.service';
24import { SvgUtilService } from '../../../../app/fw/svg/svgutil.service';
25import { FnService } from '../../../../app/fw//util/fn.service';
26import { ActivatedRoute, Router} from '@angular/router';
27
Sean Condon49e15be2018-05-16 16:58:29 +010028class MockFnService {}
Sean Condon83fc39f2018-04-19 18:56:13 +010029
Sean Condon49e15be2018-05-16 16:58:29 +010030class MockGlyphService {}
Sean Condon83fc39f2018-04-19 18:56:13 +010031
Sean Condon49e15be2018-05-16 16:58:29 +010032class MockIconService {}
Sean Condon83fc39f2018-04-19 18:56:13 +010033
34/**
35 * ONOS GUI -- SVG -- Icon Directive - Unit Tests
36 */
37describe('IconDirective', () => {
Sean Condon83fc39f2018-04-19 18:56:13 +010038 let log: LogService;
Sean Condon49e15be2018-05-16 16:58:29 +010039 const elementMock = <any>{ };
Sean Condon83fc39f2018-04-19 18:56:13 +010040
41 beforeEach(() => {
Sean Condon49e15be2018-05-16 16:58:29 +010042 log = new ConsoleLoggerService();
43
44 TestBed.configureTestingModule({
45 providers: [ IconDirective,
46 { provide: FnService, useClass: MockFnService },
47 { provide: LogService, useValue: log },
48 { provide: ElementRef, useValue: elementMock },
49 { provide: GlyphService, useClass: MockGlyphService },
50 { provide: IconService, useClass: MockIconService },
51 ]
52 });
Sean Condon83fc39f2018-04-19 18:56:13 +010053 });
54
55 afterEach(() => {
Sean Condon83fc39f2018-04-19 18:56:13 +010056 log = null;
Sean Condon83fc39f2018-04-19 18:56:13 +010057 });
58
Sean Condon49e15be2018-05-16 16:58:29 +010059 it('should create an instance', inject([IconDirective], (directive: IconDirective) => {
Sean Condon83fc39f2018-04-19 18:56:13 +010060 expect(directive).toBeTruthy();
Sean Condon49e15be2018-05-16 16:58:29 +010061 }));
Sean Condon83fc39f2018-04-19 18:56:13 +010062});