Sean Condon | 0c577f6 | 2018-11-18 22:40:05 +0000 | [diff] [blame^] | 1 | /* |
| 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 | */ |
| 16 | import { ZoomableDirective } from './zoomable.directive'; |
| 17 | import {inject, TestBed} from '@angular/core/testing'; |
| 18 | import {LogService, ConsoleLoggerService} from 'gui2-fw-lib'; |
| 19 | import {ElementRef} from '@angular/core'; |
| 20 | |
| 21 | describe('ZoomableDirective', () => { |
| 22 | let log: LogService; |
| 23 | let mockWindow: Window; |
| 24 | |
| 25 | beforeEach(() => { |
| 26 | log = new ConsoleLoggerService(); |
| 27 | |
| 28 | mockWindow = <any>{ |
| 29 | navigator: { |
| 30 | userAgent: 'HeadlessChrome', |
| 31 | vendor: 'Google Inc.' |
| 32 | } |
| 33 | }; |
| 34 | |
| 35 | TestBed.configureTestingModule({ |
| 36 | providers: [ZoomableDirective, |
| 37 | {provide: LogService, useValue: log}, |
| 38 | { provide: ElementRef, useValue: mockWindow } |
| 39 | ] |
| 40 | }); |
| 41 | }); |
| 42 | |
| 43 | it('should create an instance', inject([ZoomableDirective], (directive: ZoomableDirective) => { |
| 44 | |
| 45 | expect(directive).toBeTruthy(); |
| 46 | })); |
| 47 | }); |