blob: 101dda8583ee4b3b03f2ef31c4c62ee8a37777a5 [file] [log] [blame]
Simon Hunt737c89f2015-01-28 12:23:19 -08001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
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 Huntaabee152015-04-02 23:14:11 -070044 'cycleDeviceLabels', 'unpin', 'showMastership', 'showBadLinks',
Simon Hunt3a6eec02015-02-09 21:16:43 -080045
Matteo Scandolo209c6c62016-05-21 10:08:57 -070046 'resetAllLocations', 'addDevice', 'updateDevice', 'removeDevice',
47 'addHost', 'updateHost', 'moveHost', 'removeHost',
48 'addLink', 'updateLink', 'removeLink', 'topoStartDone'
Simon Hunt737c89f2015-01-28 12:23:19 -080049 ])).toBeTruthy();
50 });
51
52 // TODO: more tests...
53});