1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | Object.defineProperty(exports, "__esModule", { value: true });
|
18 | const chai_1 = require("chai");
|
19 | const preference_scope_1 = require("./preference-scope");
|
20 | describe('PreferenceScope', () => {
|
21 | it('getScopes() should return numbers from broadest to narrowest', () => {
|
22 | (0, chai_1.expect)(preference_scope_1.PreferenceScope.getScopes()).deep.equal([0, 1, 2, 3]);
|
23 | });
|
24 | it('getReversedScopes() should return numbers from narrowest to broadest', () => {
|
25 | (0, chai_1.expect)(preference_scope_1.PreferenceScope.getReversedScopes()).deep.equal([3, 2, 1, 0]);
|
26 | });
|
27 | it('getScopeNames() should return the names of scopes broader than the current one', () => {
|
28 | (0, chai_1.expect)(preference_scope_1.PreferenceScope.getScopeNames(preference_scope_1.PreferenceScope.Workspace)).deep.equal(['Default', 'User', 'Workspace']);
|
29 | });
|
30 | it('is() returns whether a value is a preference scope', () => {
|
31 | (0, chai_1.expect)(preference_scope_1.PreferenceScope.is(preference_scope_1.PreferenceScope.Default)).to.be.true;
|
32 | (0, chai_1.expect)(preference_scope_1.PreferenceScope.is(preference_scope_1.PreferenceScope.User)).to.be.true;
|
33 | (0, chai_1.expect)(preference_scope_1.PreferenceScope.is(preference_scope_1.PreferenceScope.Workspace)).to.be.true;
|
34 | (0, chai_1.expect)(preference_scope_1.PreferenceScope.is(preference_scope_1.PreferenceScope.Folder)).to.be.true;
|
35 | (0, chai_1.expect)(preference_scope_1.PreferenceScope.is(0)).to.be.true;
|
36 | (0, chai_1.expect)(preference_scope_1.PreferenceScope.is(1)).to.be.true;
|
37 | (0, chai_1.expect)(preference_scope_1.PreferenceScope.is(2)).to.be.true;
|
38 | (0, chai_1.expect)(preference_scope_1.PreferenceScope.is(3)).to.be.true;
|
39 | (0, chai_1.expect)(preference_scope_1.PreferenceScope.is(4)).to.be.false;
|
40 | (0, chai_1.expect)(preference_scope_1.PreferenceScope.is(-1)).to.be.false;
|
41 | (0, chai_1.expect)(preference_scope_1.PreferenceScope.is({})).to.be.false;
|
42 | (0, chai_1.expect)(preference_scope_1.PreferenceScope.is('Default')).to.be.false;
|
43 | });
|
44 | });
|
45 |
|
\ | No newline at end of file |