Bri Prebilic Cole | ef09190 | 2015-04-28 16:53:47 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame^] | 2 | * Copyright 2015-present Open Networking Laboratory |
Bri Prebilic Cole | ef09190 | 2015-04-28 16:53:47 -0700 | [diff] [blame] | 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 | |
| 17 | /* |
| 18 | ONOS GUI -- Topo View -- Topo Toolbar Service - Unit Tests |
| 19 | */ |
| 20 | describe('factory: view/topo/topoToolbar.js', function() { |
Bri Prebilic Cole | 2efc715 | 2015-04-29 15:47:06 -0700 | [diff] [blame] | 21 | var $log, fs, ttbs, prefs, ps, |
Bri Prebilic Cole | ef09190 | 2015-04-28 16:53:47 -0700 | [diff] [blame] | 22 | d3Elem; |
| 23 | |
| 24 | beforeEach(module('ovTopo', 'onosUtil', 'onosLayer', 'ngRoute', 'onosNav', |
| 25 | 'onosWidget')); |
| 26 | |
| 27 | beforeEach(inject(function (_$log_, FnService, |
| 28 | TopoToolbarService, PanelService, PrefsService) { |
| 29 | $log = _$log_; |
| 30 | fs = FnService; |
Bri Prebilic Cole | 2efc715 | 2015-04-29 15:47:06 -0700 | [diff] [blame] | 31 | ttbs = TopoToolbarService; |
Bri Prebilic Cole | ef09190 | 2015-04-28 16:53:47 -0700 | [diff] [blame] | 32 | prefs = PrefsService; |
| 33 | ps = PanelService; |
| 34 | d3Elem = d3.select('body').append('div').attr('id', 'floatpanels'); |
| 35 | ps.init(); |
| 36 | })); |
| 37 | |
| 38 | it('should define TopoToolbarService', function () { |
Bri Prebilic Cole | 2efc715 | 2015-04-29 15:47:06 -0700 | [diff] [blame] | 39 | expect(ttbs).toBeDefined(); |
Bri Prebilic Cole | ef09190 | 2015-04-28 16:53:47 -0700 | [diff] [blame] | 40 | }); |
| 41 | |
| 42 | it('should define api functions', function () { |
Bri Prebilic Cole | 2efc715 | 2015-04-29 15:47:06 -0700 | [diff] [blame] | 43 | expect(fs.areFunctions(ttbs, [ |
Bri Prebilic Cole | ef09190 | 2015-04-28 16:53:47 -0700 | [diff] [blame] | 44 | 'init', 'createToolbar', 'destroyToolbar', |
| 45 | 'keyListener', 'toggleToolbar' |
| 46 | ])).toBeTruthy(); |
| 47 | }); |
| 48 | |
Bri Prebilic Cole | 2efc715 | 2015-04-29 15:47:06 -0700 | [diff] [blame] | 49 | // NOTE: topoToolbar relies too much on topo's closure variables |
| 50 | // to adequately test it |
Bri Prebilic Cole | ef09190 | 2015-04-28 16:53:47 -0700 | [diff] [blame] | 51 | |
| 52 | }); |