GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 043e72...5d2753 )
by Benjamin
06:48 queued 02:54
created

test/reducers/components/plugins/loader.test.js   A

Complexity

Total Complexity 4
Complexity/F 1

Size

Lines of Code 62
Function Count 4

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
wmc 4
c 1
b 0
f 0
nc 1
mnd 0
bc 3
fnc 4
dl 0
loc 62
rs 10
bpm 0.75
cpm 1
noi 1
1
/* eslint-enable describe it */
2
import expect from 'expect';
3
import { fromJS } from 'immutable';
4
5
import {
6
    SET_LOADING_STATE
7
} from './../../../../src/constants/ActionTypes';
8
9
import
10
    loader
11
from './../../../../src/reducers/components/plugins/loader';
12
13
import {
14
    generateLastUpdate,
15
    resetLastUpdate
16
} from './../../../../src/util/lastUpdate';
17
18
describe('The loader reducer SET_LOADING_STATE action', () => {
19
    beforeEach(() => resetLastUpdate());
20
21
    it('Should set loading to true', () => {
22
23
        const state = fromJS({});
24
25
        const action = {
26
            type: SET_LOADING_STATE,
27
            stateKey: 'test-grid',
28
            state: true
29
        };
30
31
        expect(
32
            loader(state, action)
33
        ).toEqualImmutable(fromJS({
34
            'test-grid': {
35
                isLoading: true,
36
                lastUpdate: 1
37
            }
38
        }));
39
40
    });
41
42
    it('Should set loading to false', () => {
43
44
        const state = fromJS({});
45
46
        const action = {
47
            type: SET_LOADING_STATE,
48
            stateKey: 'test-grid',
49
            state: false
50
        };
51
52
        expect(
53
            loader(state, action)
54
        ).toEqualImmutable(fromJS({
55
            'test-grid': {
56
                isLoading: false,
57
                lastUpdate: 1
58
            }
59
        }));
60
61
    });
62
63
});