blob: 85e2f9e8b175821f6bf4e4c10dc636a0e01ec191 [file] [log] [blame]
Simon Hunt737c89f2015-01-28 12:23:19 -08001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
Simon Hunt737c89f2015-01-28 12:23:19 -08003 *
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 Force Service - Unit Tests
19 */
20describe('factory: view/topo/topoForce.js', function() {
Bri Prebilic Colef5e48b12015-04-21 14:52:36 -070021 var $log, fs, tfs, bns;
Simon Hunt737c89f2015-01-28 12:23:19 -080022
Bri Prebilic Colef5e48b12015-04-21 14:52:36 -070023 beforeEach(module('ovTopo', 'onosUtil', 'onosLayer', 'ngRoute', 'onosNav',
Matteo Scandolo812aa5a2016-04-19 18:12:45 -070024 'onosWidget', 'onosMast'));
Simon Hunt737c89f2015-01-28 12:23:19 -080025
Bri Prebilic Colef5e48b12015-04-21 14:52:36 -070026 beforeEach(inject(function (_$log_, FnService,
27 TopoForceService, ButtonService) {
Simon Hunt737c89f2015-01-28 12:23:19 -080028 $log = _$log_;
29 fs = FnService;
30 tfs = TopoForceService;
Bri Prebilic Colef5e48b12015-04-21 14:52:36 -070031 bns = ButtonService;
Simon Hunt737c89f2015-01-28 12:23:19 -080032 }));
33
Matteo Scandolo209c6c62016-05-21 10:08:57 -070034 it('should define TopoForceService', function () {
Simon Hunt737c89f2015-01-28 12:23:19 -080035 expect(tfs).toBeDefined();
36 });
37
Matteo Scandolo209c6c62016-05-21 10:08:57 -070038 it('should define api functions', function () {
Simon Hunt737c89f2015-01-28 12:23:19 -080039 expect(fs.areFunctions(tfs, [
Simon Hunt3a6eec02015-02-09 21:16:43 -080040 'initForce', 'newDim', 'destroyForce',
41
Simon Hunt14caf7c2015-03-02 15:51:18 -080042 'updateDeviceColors', 'toggleHosts',
43 'togglePorts', 'toggleOffline',
Simon Hunt10618f62017-06-15 19:30:52 -070044 'cycleDeviceLabels', 'cycleHostLabels', 'unpin',
45 'showMastership', 'showBadLinks', 'setNodeScale',
Simon Hunt3a6eec02015-02-09 21:16:43 -080046
Matteo Scandolo209c6c62016-05-21 10:08:57 -070047 'resetAllLocations', 'addDevice', 'updateDevice', 'removeDevice',
48 'addHost', 'updateHost', 'moveHost', 'removeHost',
Simon Hunte2d9dc72017-08-10 15:21:04 -070049 'addLink', 'updateLink', 'removeLink', 'topoStartDone',
50
51 'setLionBundle',
Simon Hunt737c89f2015-01-28 12:23:19 -080052 ])).toBeTruthy();
53 });
54
55 // TODO: more tests...
56});