Passed
Pull Request — main (#1)
by Pieter Epeüs
01:33
created

src/__tests__/paginator.unit.js   A

Complexity

Total Complexity 5
Complexity/F 1

Size

Lines of Code 213
Function Count 5

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 5
eloc 166
mnd 0
bc 0
fnc 5
dl 0
loc 213
rs 10
bpm 0
cpm 1
noi 401
c 0
b 0
f 0
1
import Paginator from '../paginator.js'
0 ignored issues
show
introduced by
Unexpected use of file extension "js" for "../paginator.js"
Loading history...
introduced by
Insert ;
Loading history...
2
3
const TestCases = [
4
  {
0 ignored issues
show
introduced by
Expected indentation of 4 spaces but found 2.
Loading history...
introduced by
Insert ··
Loading history...
5
    description: 'It should return the first page with 2 items',
0 ignored issues
show
introduced by
Insert ····
Loading history...
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
6
    items: [1, 2, 3, 4, 5],
0 ignored issues
show
introduced by
Replace ···· with ········
Loading history...
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
7
    page: 0,
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Insert ····
Loading history...
8
    size: 2,
0 ignored issues
show
introduced by
Replace ···· with ········
Loading history...
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
9
    url: '/',
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Replace ···· with ········
Loading history...
10
    expectedResult: {
0 ignored issues
show
introduced by
Replace ···· with ········
Loading history...
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
11
      _links: {
0 ignored issues
show
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
introduced by
Replace ······ with ············
Loading history...
12
        self: '/?size=2&page=0',
0 ignored issues
show
introduced by
Insert ········
Loading history...
introduced by
Expected indentation of 16 spaces but found 8.
Loading history...
13
        prev: null,
0 ignored issues
show
introduced by
Replace ········ with ················
Loading history...
introduced by
Expected indentation of 16 spaces but found 8.
Loading history...
14
        next: '/?size=2&page=1'
0 ignored issues
show
introduced by
Replace ········next:·'/?size=2&page=1' with ············...xt:·'/?size=2&page=1',
Loading history...
introduced by
Expected indentation of 16 spaces but found 8.
Loading history...
15
      },
0 ignored issues
show
introduced by
Replace ······ with ············
Loading history...
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
16
      count: 5,
0 ignored issues
show
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
introduced by
Insert ······
Loading history...
17
      size: 2,
0 ignored issues
show
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
introduced by
Replace ······ with ············
Loading history...
18
      page: 0,
0 ignored issues
show
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
introduced by
Replace ······ with ············
Loading history...
19
      pages: 3,
0 ignored issues
show
introduced by
Replace ······ with ············
Loading history...
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
20
      result: [1, 2]
0 ignored issues
show
introduced by
Replace ······result:·[1,·2] with ············result:·[1,·2],
Loading history...
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
21
    }
0 ignored issues
show
introduced by
Replace ····} with ········},
Loading history...
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
22
  },
0 ignored issues
show
introduced by
Expected indentation of 4 spaces but found 2.
Loading history...
introduced by
Replace ·· with ····
Loading history...
23
  {
0 ignored issues
show
introduced by
Expected indentation of 4 spaces but found 2.
Loading history...
introduced by
Replace ·· with ····
Loading history...
24
    description: 'It should return the second page with 2 items',
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Insert ····
Loading history...
25
    items: [1, 2, 3, 4, 5],
0 ignored issues
show
introduced by
Replace ···· with ········
Loading history...
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
26
    page: 1,
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Insert ····
Loading history...
27
    size: 2,
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Replace ···· with ········
Loading history...
28
    url: '/',
0 ignored issues
show
introduced by
Replace ···· with ········
Loading history...
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
29
    expectedResult: {
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Replace ···· with ········
Loading history...
30
      _links: {
0 ignored issues
show
introduced by
Replace ······ with ············
Loading history...
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
31
        self: '/?size=2&page=1',
0 ignored issues
show
introduced by
Expected indentation of 16 spaces but found 8.
Loading history...
introduced by
Replace ········ with ················
Loading history...
32
        prev: '/?size=2&page=0',
0 ignored issues
show
introduced by
Expected indentation of 16 spaces but found 8.
Loading history...
introduced by
Replace ········ with ················
Loading history...
33
        next: '/?size=2&page=2'
0 ignored issues
show
introduced by
Replace ········next:·'/?size=2&page=2' with ············...xt:·'/?size=2&page=2',
Loading history...
introduced by
Expected indentation of 16 spaces but found 8.
Loading history...
34
      },
0 ignored issues
show
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
introduced by
Replace ······ with ············
Loading history...
35
      count: 5,
0 ignored issues
show
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
introduced by
Insert ······
Loading history...
36
      size: 2,
0 ignored issues
show
introduced by
Replace ······ with ············
Loading history...
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
37
      page: 1,
0 ignored issues
show
introduced by
Replace ······ with ············
Loading history...
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
38
      pages: 3,
0 ignored issues
show
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
introduced by
Replace ······ with ············
Loading history...
39
      result: [3, 4]
0 ignored issues
show
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
introduced by
Replace ······result:·[3,·4] with ············result:·[3,·4],
Loading history...
40
    }
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Replace ····} with ········},
Loading history...
41
  },
0 ignored issues
show
introduced by
Insert ··
Loading history...
introduced by
Expected indentation of 4 spaces but found 2.
Loading history...
42
  {
0 ignored issues
show
introduced by
Expected indentation of 4 spaces but found 2.
Loading history...
introduced by
Insert ··
Loading history...
43
    description: 'It should return the last page with 1 item',
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Insert ····
Loading history...
44
    items: [1, 2, 3, 4, 5],
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Insert ····
Loading history...
45
    page: 2,
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Insert ····
Loading history...
46
    size: 2,
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Replace ···· with ········
Loading history...
47
    url: '/',
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Replace ···· with ········
Loading history...
48
    expectedResult: {
0 ignored issues
show
introduced by
Replace ···· with ········
Loading history...
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
49
      _links: {
0 ignored issues
show
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
introduced by
Replace ······ with ············
Loading history...
50
        self: '/?size=2&page=2',
0 ignored issues
show
introduced by
Expected indentation of 16 spaces but found 8.
Loading history...
introduced by
Insert ········
Loading history...
51
        prev: '/?size=2&page=1',
0 ignored issues
show
introduced by
Replace ········ with ················
Loading history...
introduced by
Expected indentation of 16 spaces but found 8.
Loading history...
52
        next: null
0 ignored issues
show
introduced by
Expected indentation of 16 spaces but found 8.
Loading history...
introduced by
Replace next:·null with ········next:·null,
Loading history...
53
      },
0 ignored issues
show
introduced by
Replace ······ with ············
Loading history...
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
54
      count: 5,
0 ignored issues
show
introduced by
Insert ······
Loading history...
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
55
      size: 2,
0 ignored issues
show
introduced by
Replace ······ with ············
Loading history...
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
56
      page: 2,
0 ignored issues
show
introduced by
Replace ······ with ············
Loading history...
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
57
      pages: 3,
0 ignored issues
show
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
introduced by
Replace ······ with ············
Loading history...
58
      result: [5]
0 ignored issues
show
introduced by
Replace ······result:·[5] with ············result:·[5],
Loading history...
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
59
    }
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Replace ····} with ········},
Loading history...
60
  },
0 ignored issues
show
introduced by
Replace ·· with ····
Loading history...
introduced by
Expected indentation of 4 spaces but found 2.
Loading history...
61
  {
0 ignored issues
show
introduced by
Expected indentation of 4 spaces but found 2.
Loading history...
introduced by
Replace ·· with ····
Loading history...
62
    description:
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Insert ····
Loading history...
63
            'It should return the second page with 2 items and no next',
64
    items: [1, 2, 3, 4],
0 ignored issues
show
introduced by
Replace ···· with ········
Loading history...
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
65
    page: 1,
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Insert ····
Loading history...
66
    size: 2,
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Replace ···· with ········
Loading history...
67
    url: '/',
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Replace ···· with ········
Loading history...
68
    expectedResult: {
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Replace ···· with ········
Loading history...
69
      _links: {
0 ignored issues
show
introduced by
Insert ······
Loading history...
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
70
        self: '/?size=2&page=1',
0 ignored issues
show
introduced by
Expected indentation of 16 spaces but found 8.
Loading history...
introduced by
Replace ········ with ················
Loading history...
71
        prev: '/?size=2&page=0',
0 ignored issues
show
introduced by
Replace ········ with ················
Loading history...
introduced by
Expected indentation of 16 spaces but found 8.
Loading history...
72
        next: null
0 ignored issues
show
introduced by
Expected indentation of 16 spaces but found 8.
Loading history...
introduced by
Replace ········next:·null with ················next:·null,
Loading history...
73
      },
0 ignored issues
show
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
introduced by
Insert ······
Loading history...
74
      count: 4,
0 ignored issues
show
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
introduced by
Insert ······
Loading history...
75
      size: 2,
0 ignored issues
show
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
introduced by
Replace ······ with ············
Loading history...
76
      page: 1,
0 ignored issues
show
introduced by
Replace ······ with ············
Loading history...
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
77
      pages: 2,
0 ignored issues
show
introduced by
Replace ······ with ············
Loading history...
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
78
      result: [3, 4]
0 ignored issues
show
introduced by
Replace ······result:·[3,·4] with ············result:·[3,·4],
Loading history...
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
79
    }
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Replace } with ····},
Loading history...
80
  },
0 ignored issues
show
introduced by
Expected indentation of 4 spaces but found 2.
Loading history...
introduced by
Insert ··
Loading history...
81
  {
0 ignored issues
show
introduced by
Expected indentation of 4 spaces but found 2.
Loading history...
introduced by
Insert ··
Loading history...
82
    description: 'It should return null for prev and next',
0 ignored issues
show
introduced by
Insert ····
Loading history...
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
83
    items: [1],
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Insert ····
Loading history...
84
    page: 0,
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Replace ···· with ········
Loading history...
85
    size: 2,
0 ignored issues
show
introduced by
Replace ···· with ········
Loading history...
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
86
    url: '/',
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Replace ···· with ········
Loading history...
87
    expectedResult: {
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Replace ···· with ········
Loading history...
88
      _links: {
0 ignored issues
show
introduced by
Replace ······ with ············
Loading history...
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
89
        self: '/?size=2&page=0',
0 ignored issues
show
introduced by
Expected indentation of 16 spaces but found 8.
Loading history...
introduced by
Insert ········
Loading history...
90
        prev: null,
0 ignored issues
show
introduced by
Expected indentation of 16 spaces but found 8.
Loading history...
introduced by
Replace ········ with ················
Loading history...
91
        next: null
0 ignored issues
show
introduced by
Expected indentation of 16 spaces but found 8.
Loading history...
introduced by
Replace ········next:·null with ················next:·null,
Loading history...
92
      },
0 ignored issues
show
introduced by
Replace ······ with ············
Loading history...
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
93
      count: 1,
0 ignored issues
show
introduced by
Insert ······
Loading history...
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
94
      size: 2,
0 ignored issues
show
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
introduced by
Replace ······ with ············
Loading history...
95
      page: 0,
0 ignored issues
show
introduced by
Replace ······ with ············
Loading history...
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
96
      pages: 1,
0 ignored issues
show
introduced by
Replace ······ with ············
Loading history...
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
97
      result: [1]
0 ignored issues
show
introduced by
Replace ······result:·[1] with ············result:·[1],
Loading history...
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
98
    }
0 ignored issues
show
introduced by
Replace ····} with ········},
Loading history...
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
99
  },
0 ignored issues
show
introduced by
Replace ·· with ····
Loading history...
introduced by
Expected indentation of 4 spaces but found 2.
Loading history...
100
  {
0 ignored issues
show
introduced by
Expected indentation of 4 spaces but found 2.
Loading history...
introduced by
Replace ·· with ····
Loading history...
101
    description: 'It should return null for prev and next and self',
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Insert ····
Loading history...
102
    items: [1],
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Replace ···· with ········
Loading history...
103
    page: 0,
0 ignored issues
show
introduced by
Replace ···· with ········
Loading history...
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
104
    size: 2,
0 ignored issues
show
introduced by
Replace ···· with ········
Loading history...
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
105
    url: null,
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Replace ···· with ········
Loading history...
106
    expectedResult: {
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Replace ···· with ········
Loading history...
107
      _links: {
0 ignored issues
show
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
introduced by
Insert ······
Loading history...
108
        self: null,
0 ignored issues
show
introduced by
Expected indentation of 16 spaces but found 8.
Loading history...
introduced by
Insert ········
Loading history...
109
        prev: null,
0 ignored issues
show
introduced by
Expected indentation of 16 spaces but found 8.
Loading history...
introduced by
Insert ········
Loading history...
110
        next: null
0 ignored issues
show
introduced by
Replace ········next:·null with ················next:·null,
Loading history...
introduced by
Expected indentation of 16 spaces but found 8.
Loading history...
111
      },
0 ignored issues
show
introduced by
Insert ······
Loading history...
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
112
      count: 1,
0 ignored issues
show
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
introduced by
Insert ······
Loading history...
113
      size: 2,
0 ignored issues
show
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
introduced by
Replace ······ with ············
Loading history...
114
      page: 0,
0 ignored issues
show
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
introduced by
Replace ······ with ············
Loading history...
115
      pages: 1,
0 ignored issues
show
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
introduced by
Replace ······ with ············
Loading history...
116
      result: [1]
0 ignored issues
show
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
introduced by
Replace ······result:·[1] with ············result:·[1],
Loading history...
117
    }
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Replace } with ····},
Loading history...
118
  },
0 ignored issues
show
introduced by
Insert ··
Loading history...
introduced by
Expected indentation of 4 spaces but found 2.
Loading history...
119
  {
0 ignored issues
show
introduced by
Expected indentation of 4 spaces but found 2.
Loading history...
introduced by
Replace ·· with ····
Loading history...
120
    description: 'It should use page 0 and size 10 by default',
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Insert ····
Loading history...
121
    items: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
0 ignored issues
show
introduced by
Replace ···· with ········
Loading history...
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
122
    page: null,
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Insert ····
Loading history...
123
    size: null,
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Replace ···· with ········
Loading history...
124
    url: '/?test=true',
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Insert ····
Loading history...
125
    expectedResult: {
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Replace ···· with ········
Loading history...
126
      _links: {
0 ignored issues
show
introduced by
Insert ······
Loading history...
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
127
        self: '/?test=true&size=10&page=0',
0 ignored issues
show
introduced by
Expected indentation of 16 spaces but found 8.
Loading history...
introduced by
Insert ········
Loading history...
128
        prev: null,
0 ignored issues
show
introduced by
Replace ········ with ················
Loading history...
introduced by
Expected indentation of 16 spaces but found 8.
Loading history...
129
        next: '/?test=true&size=10&page=1'
0 ignored issues
show
introduced by
Expected indentation of 16 spaces but found 8.
Loading history...
introduced by
Replace ········next:·'...st=true&size=10&page=1' with ············...t=true&size=10&page=1',
Loading history...
130
      },
0 ignored issues
show
introduced by
Insert ······
Loading history...
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
131
      count: 11,
0 ignored issues
show
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
introduced by
Insert ······
Loading history...
132
      size: 10,
0 ignored issues
show
introduced by
Replace ······ with ············
Loading history...
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
133
      page: 0,
0 ignored issues
show
introduced by
Replace ······ with ············
Loading history...
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
134
      pages: 2,
0 ignored issues
show
introduced by
Replace ······ with ············
Loading history...
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
135
      result: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
0 ignored issues
show
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
introduced by
Replace ······result:·[1,...5,·6,·7,·8,·9,·10] with ············...,·6,·7,·8,·9,·10],
Loading history...
136
    }
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Replace } with ····},
Loading history...
137
  }
0 ignored issues
show
introduced by
Replace ··} with ····},
Loading history...
introduced by
Expected indentation of 4 spaces but found 2.
Loading history...
138
]
0 ignored issues
show
introduced by
Insert ;
Loading history...
139
140
describe.each(TestCases)(
0 ignored issues
show
Bug introduced by
The variable describe seems to be never declared. If this is a global, consider adding a /** global: describe */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
141
  'Paginator helper',
0 ignored issues
show
introduced by
Expected indentation of 4 spaces but found 2.
Loading history...
introduced by
Insert ··
Loading history...
142
  ({ description, items, page, size, url, expectedResult }) => {
0 ignored issues
show
introduced by
Insert ··
Loading history...
introduced by
Expected indentation of 4 spaces but found 2.
Loading history...
143
    it(description, () => {
0 ignored issues
show
introduced by
Replace ···· with ········
Loading history...
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
144
      const results = Paginator({
0 ignored issues
show
introduced by
Insert ······
Loading history...
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
145
        items,
0 ignored issues
show
introduced by
Expected indentation of 16 spaces but found 8.
Loading history...
introduced by
Insert ········
Loading history...
146
        page,
0 ignored issues
show
introduced by
Expected indentation of 16 spaces but found 8.
Loading history...
introduced by
Insert ········
Loading history...
147
        size,
0 ignored issues
show
introduced by
Replace ········ with ················
Loading history...
introduced by
Expected indentation of 16 spaces but found 8.
Loading history...
148
        url
0 ignored issues
show
introduced by
Replace ········url with ················url,
Loading history...
introduced by
Expected indentation of 16 spaces but found 8.
Loading history...
149
      })
0 ignored issues
show
introduced by
Replace ······}) with ············});
Loading history...
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
150
151
      expect(results.data).toEqual(expectedResult)
0 ignored issues
show
introduced by
Replace ······expect(resul...toEqual(expectedResult) with ············...oEqual(expectedResult);
Loading history...
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
152
    })
0 ignored issues
show
introduced by
Replace ····}) with ········});
Loading history...
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
153
  }
0 ignored issues
show
introduced by
Insert ··
Loading history...
introduced by
Expected indentation of 4 spaces but found 2.
Loading history...
154
)
0 ignored issues
show
introduced by
Insert ;
Loading history...
155
156
const ErrorTestCases = [
157
  {
0 ignored issues
show
introduced by
Expected indentation of 4 spaces but found 2.
Loading history...
introduced by
Insert ··
Loading history...
158
    description: 'It should throw an error if the items arent an array',
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Insert ····
Loading history...
159
    props: {
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Insert ····
Loading history...
160
      items: null
0 ignored issues
show
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
introduced by
Replace ······items:·null with ············items:·null,
Loading history...
161
    },
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Insert ····
Loading history...
162
    expectedResult: 'items is not an array'
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Replace ...ms·is·not·an·array' with ········expected...s·is·not·an·array',
Loading history...
163
  },
0 ignored issues
show
introduced by
Insert ··
Loading history...
introduced by
Expected indentation of 4 spaces but found 2.
Loading history...
164
  {
0 ignored issues
show
introduced by
Expected indentation of 4 spaces but found 2.
Loading history...
introduced by
Insert ··
Loading history...
165
    description: 'It should throw an error if the items arent an array',
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Replace ···· with ········
Loading history...
166
    props: {
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Insert ····
Loading history...
167
      items: 1
0 ignored issues
show
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
introduced by
Replace ······items:·1 with ············items:·1,
Loading history...
168
    },
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Replace ···· with ········
Loading history...
169
    expectedResult: 'items is not an array'
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Replace ...ms·is·not·an·array' with ········expected...s·is·not·an·array',
Loading history...
170
  },
0 ignored issues
show
introduced by
Expected indentation of 4 spaces but found 2.
Loading history...
introduced by
Insert ··
Loading history...
171
  {
0 ignored issues
show
introduced by
Expected indentation of 4 spaces but found 2.
Loading history...
introduced by
Insert ··
Loading history...
172
    description: 'It should throw an error if the page is not a number',
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Insert ····
Loading history...
173
    props: {
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Insert ····
Loading history...
174
      items: [],
0 ignored issues
show
introduced by
Replace ······ with ············
Loading history...
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
175
      page: 'a'
0 ignored issues
show
introduced by
Replace ······page:·'a' with ············page:·'a',
Loading history...
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
176
    },
0 ignored issues
show
introduced by
Insert ····
Loading history...
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
177
    expectedResult: 'page is not a valid number'
0 ignored issues
show
introduced by
Replace ... with ········expected...not·a·valid·number',
Loading history...
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
178
  },
0 ignored issues
show
introduced by
Expected indentation of 4 spaces but found 2.
Loading history...
introduced by
Insert ··
Loading history...
179
  {
0 ignored issues
show
introduced by
Expected indentation of 4 spaces but found 2.
Loading history...
introduced by
Insert ··
Loading history...
180
    description:
0 ignored issues
show
introduced by
Replace ···· with ········
Loading history...
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
181
            'It should throw an error if the page number is to high or low',
182
    props: {
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Insert ····
Loading history...
183
      items: [],
0 ignored issues
show
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
introduced by
Replace ······ with ············
Loading history...
184
      page: 2
0 ignored issues
show
introduced by
Replace ······page:·2 with ············page:·2,
Loading history...
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
185
    },
0 ignored issues
show
introduced by
Replace ···· with ········
Loading history...
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
186
    expectedResult: 'page is not a valid number'
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Replace ... with ········expected...not·a·valid·number',
Loading history...
187
  },
0 ignored issues
show
introduced by
Insert ··
Loading history...
introduced by
Expected indentation of 4 spaces but found 2.
Loading history...
188
  {
0 ignored issues
show
introduced by
Expected indentation of 4 spaces but found 2.
Loading history...
introduced by
Insert ··
Loading history...
189
    description: 'It should throw an error if the size is not a number',
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Insert ····
Loading history...
190
    props: {
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Insert ····
Loading history...
191
      items: [],
0 ignored issues
show
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
introduced by
Insert ······
Loading history...
192
      size: 'a'
0 ignored issues
show
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
introduced by
Replace size:·'a' with ······size:·'a',
Loading history...
193
    },
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Replace ···· with ········
Loading history...
194
    expectedResult: 'size is not a valid positive number'
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Replace ...alid·positive·number' with ········expected...lid·positive·number',
Loading history...
195
  },
0 ignored issues
show
introduced by
Insert ··
Loading history...
introduced by
Expected indentation of 4 spaces but found 2.
Loading history...
196
  {
0 ignored issues
show
introduced by
Expected indentation of 4 spaces but found 2.
Loading history...
introduced by
Insert ··
Loading history...
197
    description: 'It should throw an error if the url is not a string',
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Insert ····
Loading history...
198
    props: {
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Insert ····
Loading history...
199
      items: [],
0 ignored issues
show
introduced by
Replace ······ with ············
Loading history...
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
200
      url: 1
0 ignored issues
show
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
introduced by
Replace ······url:·1 with ············url:·1,
Loading history...
201
    },
0 ignored issues
show
introduced by
Replace ···· with ········
Loading history...
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
202
    expectedResult: 'url is not a valid string'
0 ignored issues
show
introduced by
Replace ... with ········expected...not·a·valid·string',
Loading history...
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
203
  }
0 ignored issues
show
introduced by
Replace ··} with ····},
Loading history...
introduced by
Expected indentation of 4 spaces but found 2.
Loading history...
204
]
0 ignored issues
show
introduced by
Insert ;
Loading history...
205
206
describe.each(ErrorTestCases)(
207
  'test paginator validation',
0 ignored issues
show
introduced by
Expected indentation of 4 spaces but found 2.
Loading history...
introduced by
Insert ··
Loading history...
208
  ({ description, props, expectedResult }) => {
0 ignored issues
show
introduced by
Insert ··
Loading history...
introduced by
Expected indentation of 4 spaces but found 2.
Loading history...
209
    it(description, () => {
0 ignored issues
show
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
introduced by
Insert ····
Loading history...
210
      expect(() => Paginator(props)).toThrowError(expectedResult)
0 ignored issues
show
introduced by
Expected indentation of 12 spaces but found 6.
Loading history...
introduced by
Replace expect(()·=>·Paginator...owError(expectedResult) with ······expect(()·=...wError(expectedResult);
Loading history...
211
    })
0 ignored issues
show
introduced by
Replace ····}) with ········});
Loading history...
introduced by
Expected indentation of 8 spaces but found 4.
Loading history...
212
  }
0 ignored issues
show
introduced by
Insert ··
Loading history...
introduced by
Expected indentation of 4 spaces but found 2.
Loading history...
213
)
0 ignored issues
show
introduced by
Insert ;
Loading history...
214