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
Branch master (5d2753)
by Benjamin
17:29 queued 13:40
created

test/reducers/components/grid.test.js   A

Complexity

Total Complexity 10
Complexity/F 1

Size

Lines of Code 105
Function Count 10

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 0
wmc 10
c 1
b 0
f 1
nc 1
mnd 0
bc 7
fnc 10
dl 0
loc 105
rs 10
bpm 0.7
cpm 1
noi 0
1
/* eslint-enable describe it */
2
import expect from 'expect';
3
import { fromJS } from 'immutable';
4
5
import {
6
    SET_COLUMNS,
7
    RESIZE_COLUMNS,
8
    SET_SORT_DIRECTION
9
} from './../../../src/constants/ActionTypes';
10
11
import
12
    grid
13
from './../../../src/reducers/components/grid';
14
15
import {
16
    resetLastUpdate
17
} from './../../../src/util/lastUpdate';
18
19
const columns = [
20
    {
21
        name: 'col1',
22
        renderer: () => {},
23
        dataIndex: 'col-1'
24
    },
25
    {
26
        name: 'col2',
27
        dataIndex: 'col-2'
28
    }
29
];
30
31
describe('The grid reducer setCol func', () => {
32
    beforeEach(() => resetLastUpdate());
33
34
    const state = fromJS({});
35
36
    const action = {
37
        stateKey: 'test-grid',
38
        type: SET_COLUMNS,
39
        columns
40
    };
41
42
    const outState = fromJS({
43
        'test-grid': {
44
            columns,
45
            lastUpdate: 1
46
        }
47
    });
48
49
    it('Should set passing cols', () => {
50
        expect(
51
            grid(state, action)
52
        ).toEqualImmutable(outState);
53
    });
54
55
});
56
57
describe('The grid reducer SET_SORT_DIRECTION func', () => {
58
    beforeEach(() => resetLastUpdate());
59
60
    const state = fromJS({});
61
62
    const action = {
63
        stateKey: 'test-grid',
64
        type: SET_SORT_DIRECTION,
65
        columns
66
    };
67
68
    const outState = fromJS({
69
        'test-grid': {
70
            columns,
71
            lastUpdate: 1
72
        }
73
    });
74
75
    it('Should set cols after sort action', () => {
76
        expect(
77
            grid(state, action)
78
        ).toEqualImmutable(outState);
79
    });
80
});
81
82
describe('The grid reducer resizeCols func', () => {
83
    beforeEach(() => resetLastUpdate());
84
85
    const state = fromJS({});
86
87
    const action = {
88
        stateKey: 'test-grid',
89
        type: RESIZE_COLUMNS,
90
        columns
91
    };
92
93
    const outState = fromJS({
94
        'test-grid': {
95
            columns,
96
            lastUpdate: 1
97
        }
98
    });
99
100
    it('Should set cols after resize action', () => {
101
        expect(
102
            grid(state, action)
103
        ).toEqualImmutable(outState);
104
    });
105
106
});