blob: fd04a51371d5e034546925d1d144cd76cb569de9 [file] [log] [blame]
Bri Prebilic Coleef091902015-04-28 16:53:47 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Bri Prebilic Coleef091902015-04-28 16:53:47 -07003 *
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 */
20describe('factory: view/topo/topoToolbar.js', function() {
Bri Prebilic Cole2efc7152015-04-29 15:47:06 -070021 var $log, fs, ttbs, prefs, ps,
Bri Prebilic Coleef091902015-04-28 16:53:47 -070022 d3Elem;
23
24 beforeEach(module('ovTopo', 'onosUtil', 'onosLayer', 'ngRoute', 'onosNav',
Matteo Scandolo812aa5a2016-04-19 18:12:45 -070025 'onosWidget', 'onosMast'));
Bri Prebilic Coleef091902015-04-28 16:53:47 -070026
27 beforeEach(inject(function (_$log_, FnService,
28 TopoToolbarService, PanelService, PrefsService) {
29 $log = _$log_;
30 fs = FnService;
Bri Prebilic Cole2efc7152015-04-29 15:47:06 -070031 ttbs = TopoToolbarService;
Bri Prebilic Coleef091902015-04-28 16:53:47 -070032 prefs = PrefsService;
33 ps = PanelService;
34 d3Elem = d3.select('body').append('div').attr('id', 'floatpanels');
35 ps.init();
36 }));
37
Matteo Scandolo812aa5a2016-04-19 18:12:45 -070038 xit('should define TopoToolbarService', function () {
Bri Prebilic Cole2efc7152015-04-29 15:47:06 -070039 expect(ttbs).toBeDefined();
Bri Prebilic Coleef091902015-04-28 16:53:47 -070040 });
41
Matteo Scandolo812aa5a2016-04-19 18:12:45 -070042 xit('should define api functions', function () {
Bri Prebilic Cole2efc7152015-04-29 15:47:06 -070043 expect(fs.areFunctions(ttbs, [
Bri Prebilic Coleef091902015-04-28 16:53:47 -070044 'init', 'createToolbar', 'destroyToolbar',
45 'keyListener', 'toggleToolbar'
46 ])).toBeTruthy();
47 });
48
Bri Prebilic Cole2efc7152015-04-29 15:47:06 -070049 // NOTE: topoToolbar relies too much on topo's closure variables
50 // to adequately test it
Bri Prebilic Coleef091902015-04-28 16:53:47 -070051
52});