Bri Prebilic Cole | ef09190 | 2015-04-28 16:53:47 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 Open Networking Laboratory |
| 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() { |
| 21 | var $log, fs, tts, prefs, ps, |
| 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; |
| 31 | tts = TopoToolbarService; |
| 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 () { |
| 39 | expect(tts).toBeDefined(); |
| 40 | }); |
| 41 | |
| 42 | it('should define api functions', function () { |
| 43 | expect(fs.areFunctions(tts, [ |
| 44 | 'init', 'createToolbar', 'destroyToolbar', |
| 45 | 'keyListener', 'toggleToolbar' |
| 46 | ])).toBeTruthy(); |
| 47 | }); |
| 48 | |
| 49 | function verifyFirstRow() { |
| 50 | |
| 51 | } |
| 52 | |
| 53 | function verifySecondRow() { |
| 54 | |
| 55 | } |
| 56 | |
| 57 | function verifyThirdRow() { |
| 58 | |
| 59 | } |
| 60 | |
| 61 | it('should create a toolbar', function () { |
| 62 | //var toolbar = tts.createToolbar('foo'); |
| 63 | //expect(toolbar).toBeTruthy(); |
| 64 | //expect(d3.select('#toolbar-foo').empty()).toBe(false); |
| 65 | //verifyFirstRow(); |
| 66 | //verifySecondRow(); |
| 67 | //verifyThirdRow(); |
| 68 | }); |
| 69 | |
| 70 | }); |