blob: 76e6dfe4ca1155f070c7ce38acde734dcdb6397c [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 Scandolo812aa5a2016-04-19 18:12:45 -070020xdescribe('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, [
Simon Huntfcbde892015-04-16 12:05:28 -070047 'getPrefs', 'asNumbers', 'setPrefs'
Simon Huntc7ae7952015-04-08 18:59:27 -070048 ])).toBe(true);
49 });
50
51 // === Tests for getPrefs()
52 // TODO unit tests for getPrefs()
53
Simon Huntfcbde892015-04-16 12:05:28 -070054 // === Tests for asNumbers()
55 // TODO unit tests for asNumbers()
56
Simon Huntc7ae7952015-04-08 18:59:27 -070057 // === Tests for setPrefs()
58 // TODO unit tests for setPrefs()
59
60});