Total Complexity | 7 |
Complexity/F | 1 |
Lines of Code | 75 |
Function Count | 7 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | import expect from 'expect'; |
||
2 | import { isPluginEnabled } from './../../src/util/isPluginEnabled'; |
||
3 | |||
4 | describe('isPluginEnabled utility function', () => { |
||
5 | |||
6 | it('Should return enabled', () => { |
||
7 | const plugins = { |
||
8 | BULK_ACTIONS: { |
||
9 | enabled: true |
||
10 | } |
||
11 | }; |
||
12 | |||
13 | expect(isPluginEnabled( |
||
14 | plugins, 'BULK_ACTIONS' |
||
15 | )).toEqual( |
||
16 | true |
||
17 | ); |
||
18 | }); |
||
19 | |||
20 | it('Should return not enabled', () => { |
||
21 | const plugins = { |
||
22 | BULK_ACTIONS: { |
||
23 | enabled: false |
||
24 | } |
||
25 | }; |
||
26 | |||
27 | expect(isPluginEnabled( |
||
28 | plugins, 'BULK_ACTIONS' |
||
29 | )).toEqual( |
||
30 | false |
||
31 | ); |
||
32 | }); |
||
33 | |||
34 | it('Should return not enabled', () => { |
||
35 | const plugins = {}; |
||
36 | |||
37 | expect(isPluginEnabled( |
||
38 | plugins, 'BULK_ACTIONS' |
||
39 | )).toEqual( |
||
40 | false |
||
41 | ); |
||
42 | }); |
||
43 | |||
44 | it('Should return not enabled', () => { |
||
45 | expect(isPluginEnabled( |
||
46 | null, 'BULK_ACTIONS' |
||
47 | )).toEqual( |
||
48 | false |
||
49 | ); |
||
50 | }); |
||
51 | |||
52 | it('Should return not enabled', () => { |
||
53 | expect(isPluginEnabled( |
||
54 | false, 'BULK_ACTIONS' |
||
55 | )).toEqual( |
||
56 | false |
||
57 | ); |
||
58 | }); |
||
59 | |||
60 | it('Should return not enabled', () => { |
||
61 | |||
62 | const plugins = { |
||
63 | BULK_ACTIONS: { |
||
64 | enabled: true |
||
65 | } |
||
66 | }; |
||
67 | |||
68 | expect(isPluginEnabled( |
||
69 | false, 'BULK_ACTIS' |
||
70 | )).toEqual( |
||
71 | false |
||
72 | ); |
||
73 | }); |
||
74 | |||
75 | }); |