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/util/getTreePathFromId.test.js   A

Complexity

Total Complexity 2
Complexity/F 1

Size

Lines of Code 66
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
wmc 2
c 1
b 0
f 0
nc 1
mnd 0
bc 2
fnc 2
dl 0
loc 66
rs 10
bpm 1
cpm 1
noi 0
1
/* eslint-enable describe it sinon */
2
3
import expect from 'expect';
4
5
import {
6
    getTreePathFromId
7
} from './../../src/util/getTreePathFromId';
8
9
import {
10
    treeToFlatList
11
} from './../../src/util/treeToFlatList';
12
13
describe('the treeFlatList utility', () => {
14
15
    it('Should turn a tree into a flat list with no identifier', () => {
16
17
        const data = {
18
            root: {
19
                id: -1,
20
                children: [
21
                    {
22
                        id: 1,
23
                        parentId: -1,
24
                        children: [
25
                            {
26
                                id: 11,
27
                                parentId: 1
28
                            },
29
                            {
30
                                id: 12,
31
                                parentId: 1,
32
                                children: [
33
                                    {
34
                                        id: 121,
35
                                        parentId: 12,
36
                                        children: [
37
                                            {
38
                                                id: 1211,
39
                                                parentId: 121
40
                                            }
41
                                        ]
42
                                    }
43
                                ]
44
                            }
45
                        ]
46
                    },
47
                    {
48
                        id: 2,
49
                        parentId: -1,
50
                        children: [
51
                            {
52
                                id: 21,
53
                                parentId: 2
54
                            }
55
                        ]
56
                    }
57
                ]
58
            }
59
        };
60
61
        const flat = treeToFlatList(data);
62
63
        expect(
64
            getTreePathFromId(flat, 121)
65
        ).toEqual([-1, 1, 12, 121]);
66
    });
67
68
});
69