blob: bd1c172734811b2cff02a2f445305614c461b120 [file] [log] [blame]
Simon Huntb0ec1e52015-01-28 18:13:49 -08001/*
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 Panel Service - Unit Tests
19 */
20describe('factory: view/topo/topoPanel.js', function() {
Bri Prebilic Colef5e48b12015-04-21 14:52:36 -070021 var $log, fs, tps, bns;
Simon Huntb0ec1e52015-01-28 18:13:49 -080022
Bri Prebilic Colef5e48b12015-04-21 14:52:36 -070023 beforeEach(module('ovTopo', 'onosUtil', 'onosLayer', 'ngRoute', 'onosNav',
24 'onosWidget'));
Simon Huntb0ec1e52015-01-28 18:13:49 -080025
Bri Prebilic Colef5e48b12015-04-21 14:52:36 -070026 beforeEach(inject(function (_$log_, FnService,
27 TopoPanelService, ButtonService) {
Simon Huntb0ec1e52015-01-28 18:13:49 -080028 $log = _$log_;
29 fs = FnService;
30 tps = TopoPanelService;
Bri Prebilic Colef5e48b12015-04-21 14:52:36 -070031 bns = ButtonService;
Simon Huntb0ec1e52015-01-28 18:13:49 -080032 }));
33
34 it('should define TopoPanelService', function () {
35 expect(tps).toBeDefined();
36 });
37
38 it('should define api functions', function () {
39 expect(fs.areFunctions(tps, [
Simon Hunt08f841d02015-02-10 14:39:20 -080040 'initPanels',
41 'destroyPanels',
42 'showSummary',
Simon Hunt6036b192015-02-11 11:20:26 -080043 'toggleSummary',
Simon Hunt239e5882015-04-23 15:07:04 -070044 'toggleUseDetailsFlag',
Simon Hunt08f841d02015-02-10 14:39:20 -080045 'displaySingle',
46 'displayMulti',
47 'addAction',
Simon Hunt3074fb22015-03-31 15:06:25 -070048 'displayLink',
49 'displayNothing',
50 'displaySomething',
Simon Huntc252aa62015-02-10 16:45:39 -080051 'hideSummaryPanel',
Simon Hunt08f841d02015-02-10 14:39:20 -080052 'detailVisible',
53 'summaryVisible'
Simon Huntb0ec1e52015-01-28 18:13:49 -080054 ])).toBeTruthy();
55 });
56
57 // TODO: more tests...
58});