blob: a047aba0fce9bc90a852cc5223352db24000d14a [file] [log] [blame]
Simon Huntc7ae7952015-04-08 18:59:27 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
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
Matteo Scandolo812aa5a2016-04-19 18:12:45 -070023 beforeEach(module('onosUtil', '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, [
Matteo Scandolo209c6c62016-05-21 10:08:57 -070047 'getPrefs', 'asNumbers', 'setPrefs',
48 '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
61});