blob: 91cea6c84d29a8ad071af35b1ea47a1bba7bec96 [file] [log] [blame]
Simon Huntc7ae7952015-04-08 18:59:27 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
Simon Huntc7ae7952015-04-08 18:59:27 -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 -- Util -- User Preference Service - Unit Tests
19 */
Matteo Scandolo209c6c62016-05-21 10:08:57 -070020describe('factory: fw/util/prefs.js', function() {
Simon Huntc7ae7952015-04-08 18:59:27 -070021 var $cookies, ps, fs;
22
Laszlo Papp759f0d32018-03-05 13:24:30 +000023 beforeEach(module('onosUtil', 'onosSvg', 'onosRemote'));
Simon Huntc7ae7952015-04-08 18:59:27 -070024
25 var mockCookies = {
26 foo: 'bar'
27 };
28
29 beforeEach(function () {
30 module(function ($provide) {
31 $provide.value('$cookies', mockCookies);
32 });
33 });
34
35 beforeEach(inject(function (PrefsService, FnService, _$cookies_) {
36 ps = PrefsService;
37 fs = FnService;
38 $cookies = _$cookies_;
39 }));
40
41 it('should define PrefsService', function () {
42 expect(ps).toBeDefined();
43 });
44
45 it('should define api functions', function () {
46 expect(fs.areFunctions(ps, [
Simon Hunt95f4b422017-03-03 13:49:05 -080047 'getPrefs', 'asNumbers', 'setPrefs', 'mergePrefs',
Matteo Scandolo209c6c62016-05-21 10:08:57 -070048 'addListener', 'removeListener'
Simon Huntc7ae7952015-04-08 18:59:27 -070049 ])).toBe(true);
50 });
51
52 // === Tests for getPrefs()
53 // TODO unit tests for getPrefs()
54
Simon Huntfcbde892015-04-16 12:05:28 -070055 // === Tests for asNumbers()
56 // TODO unit tests for asNumbers()
57
Simon Huntc7ae7952015-04-08 18:59:27 -070058 // === Tests for setPrefs()
59 // TODO unit tests for setPrefs()
60
Simon Hunt95f4b422017-03-03 13:49:05 -080061 // === Tests for mergePrefs()
62 // TODO unit tests for mergePrefs()
63
Simon Huntc7ae7952015-04-08 18:59:27 -070064});