Sean Condon | 83fc39f | 2018-04-19 18:56:13 +0100 | [diff] [blame] | 1 | /* |
| 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 Condon | 49e15be | 2018-05-16 16:58:29 +0100 | [diff] [blame^] | 16 | import { TestBed, inject } from '@angular/core/testing'; |
| 17 | |
| 18 | import { ElementRef } from '@angular/core'; |
Sean Condon | 83fc39f | 2018-04-19 18:56:13 +0100 | [diff] [blame] | 19 | import { LogService } from '../../../../app/log.service'; |
Sean Condon | 49e15be | 2018-05-16 16:58:29 +0100 | [diff] [blame^] | 20 | import { ConsoleLoggerService } from '../../../../app/consolelogger.service'; |
| 21 | import { IconDirective } from '../../../../app/fw/svg/icon.directive'; |
Sean Condon | 83fc39f | 2018-04-19 18:56:13 +0100 | [diff] [blame] | 22 | import { IconService } from '../../../../app/fw/svg/icon.service'; |
| 23 | import { GlyphService } from '../../../../app/fw/svg/glyph.service'; |
| 24 | import { SvgUtilService } from '../../../../app/fw/svg/svgutil.service'; |
| 25 | import { FnService } from '../../../../app/fw//util/fn.service'; |
| 26 | import { ActivatedRoute, Router} from '@angular/router'; |
| 27 | |
Sean Condon | 49e15be | 2018-05-16 16:58:29 +0100 | [diff] [blame^] | 28 | class MockFnService {} |
Sean Condon | 83fc39f | 2018-04-19 18:56:13 +0100 | [diff] [blame] | 29 | |
Sean Condon | 49e15be | 2018-05-16 16:58:29 +0100 | [diff] [blame^] | 30 | class MockGlyphService {} |
Sean Condon | 83fc39f | 2018-04-19 18:56:13 +0100 | [diff] [blame] | 31 | |
Sean Condon | 49e15be | 2018-05-16 16:58:29 +0100 | [diff] [blame^] | 32 | class MockIconService {} |
Sean Condon | 83fc39f | 2018-04-19 18:56:13 +0100 | [diff] [blame] | 33 | |
| 34 | /** |
| 35 | * ONOS GUI -- SVG -- Icon Directive - Unit Tests |
| 36 | */ |
| 37 | describe('IconDirective', () => { |
Sean Condon | 83fc39f | 2018-04-19 18:56:13 +0100 | [diff] [blame] | 38 | let log: LogService; |
Sean Condon | 49e15be | 2018-05-16 16:58:29 +0100 | [diff] [blame^] | 39 | const elementMock = <any>{ }; |
Sean Condon | 83fc39f | 2018-04-19 18:56:13 +0100 | [diff] [blame] | 40 | |
| 41 | beforeEach(() => { |
Sean Condon | 49e15be | 2018-05-16 16:58:29 +0100 | [diff] [blame^] | 42 | 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 Condon | 83fc39f | 2018-04-19 18:56:13 +0100 | [diff] [blame] | 53 | }); |
| 54 | |
| 55 | afterEach(() => { |
Sean Condon | 83fc39f | 2018-04-19 18:56:13 +0100 | [diff] [blame] | 56 | log = null; |
Sean Condon | 83fc39f | 2018-04-19 18:56:13 +0100 | [diff] [blame] | 57 | }); |
| 58 | |
Sean Condon | 49e15be | 2018-05-16 16:58:29 +0100 | [diff] [blame^] | 59 | it('should create an instance', inject([IconDirective], (directive: IconDirective) => { |
Sean Condon | 83fc39f | 2018-04-19 18:56:13 +0100 | [diff] [blame] | 60 | expect(directive).toBeTruthy(); |
Sean Condon | 49e15be | 2018-05-16 16:58:29 +0100 | [diff] [blame^] | 61 | })); |
Sean Condon | 83fc39f | 2018-04-19 18:56:13 +0100 | [diff] [blame] | 62 | }); |