-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathserviceTabVisibility.unit.js
More file actions
34 lines (30 loc) · 1.01 KB
/
serviceTabVisibility.unit.js
File metadata and controls
34 lines (30 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
'use strict';
describe('serviceTabVisibility'.bold.underline.blue, function () {
describe('isTabNameValid', function () {
var isTabVisible;
var $rootScope;
var keypather;
beforeEach(function () {
angular.mock.module('app');
angular.mock.inject(function (
_$rootScope_,
_keypather_,
_isTabVisible_
) {
$rootScope = _$rootScope_;
keypather = _keypather_;
isTabVisible = _isTabVisible_;
});
});
it('should return false for an undefined tab', function () {
expect(isTabVisible('thingthatdoesntexist')).to.equal(false);
expect(isTabVisible('thiasdfng')).to.equal(false);
});
it('should return false for a feature flag that is disabled', function () {
keypather.set($rootScope, 'featureFlags.whitelist', true);
expect(isTabVisible('whitelist')).to.equal(true);
keypather.set($rootScope, 'featureFlags.whitelist', false);
expect(isTabVisible('whitelist')).to.equal(false);
});
});
});