Simon Hunt | c7ae795 | 2015-04-08 18:59:27 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Laboratory |
Simon Hunt | c7ae795 | 2015-04-08 18:59:27 -0700 | [diff] [blame] | 3 | * |
| 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 Scandolo | 209c6c6 | 2016-05-21 10:08:57 -0700 | [diff] [blame] | 20 | describe('factory: fw/util/prefs.js', function() { |
Simon Hunt | c7ae795 | 2015-04-08 18:59:27 -0700 | [diff] [blame] | 21 | var $cookies, ps, fs; |
| 22 | |
Matteo Scandolo | 812aa5a | 2016-04-19 18:12:45 -0700 | [diff] [blame] | 23 | beforeEach(module('onosUtil', 'onosRemote')); |
Simon Hunt | c7ae795 | 2015-04-08 18:59:27 -0700 | [diff] [blame] | 24 | |
| 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 Hunt | 95f4b42 | 2017-03-03 13:49:05 -0800 | [diff] [blame] | 47 | 'getPrefs', 'asNumbers', 'setPrefs', 'mergePrefs', |
Matteo Scandolo | 209c6c6 | 2016-05-21 10:08:57 -0700 | [diff] [blame] | 48 | 'addListener', 'removeListener' |
Simon Hunt | c7ae795 | 2015-04-08 18:59:27 -0700 | [diff] [blame] | 49 | ])).toBe(true); |
| 50 | }); |
| 51 | |
| 52 | // === Tests for getPrefs() |
| 53 | // TODO unit tests for getPrefs() |
| 54 | |
Simon Hunt | fcbde89 | 2015-04-16 12:05:28 -0700 | [diff] [blame] | 55 | // === Tests for asNumbers() |
| 56 | // TODO unit tests for asNumbers() |
| 57 | |
Simon Hunt | c7ae795 | 2015-04-08 18:59:27 -0700 | [diff] [blame] | 58 | // === Tests for setPrefs() |
| 59 | // TODO unit tests for setPrefs() |
| 60 | |
Simon Hunt | 95f4b42 | 2017-03-03 13:49:05 -0800 | [diff] [blame] | 61 | // === Tests for mergePrefs() |
| 62 | // TODO unit tests for mergePrefs() |
| 63 | |
Simon Hunt | c7ae795 | 2015-04-08 18:59:27 -0700 | [diff] [blame] | 64 | }); |