adminmate-express-mongoose 1.2.5 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -0
- package/index.js +7 -0
- package/jest.config.js +0 -1
- package/package.json +15 -6
- package/src/controllers/chart-ranking.js +49 -2
- package/src/controllers/chart-time.js +11 -8
- package/src/controllers/model-autocomplete.js +2 -2
- package/src/controllers/model-getall.js +8 -8
- package/src/controllers/model-getone.js +5 -4
- package/src/controllers/model-getrefs.js +53 -0
- package/src/helpers/functions.js +23 -0
- package/database.js +0 -16
- package/docker-compose.yml +0 -12
- package/migration.js +0 -234
- package/models/blocked.js +0 -17
- package/models/car.js +0 -26
- package/models/user.js +0 -25
- package/test/__snapshots__/chart-bar.shot +0 -389
- package/test/__snapshots__/chart-pie.shot +0 -19
- package/test/__snapshots__/model-getall.shot +0 -656
- package/test/app.js +0 -50
- package/test/mongodb.test.js +0 -25
- package/test/tests/model-getall.test.js +0 -156
- package/test/tests/model-query.test.js +0 -52
package/migration.js
DELETED
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
const { models, connectDb } = require('./database');
|
|
2
|
-
|
|
3
|
-
connectDb().then(async () => {
|
|
4
|
-
console.log('MongoDB connected');
|
|
5
|
-
|
|
6
|
-
// Remove all entries
|
|
7
|
-
await Promise.all([
|
|
8
|
-
models.User.deleteMany({}),
|
|
9
|
-
models.Car.deleteMany({}),
|
|
10
|
-
models.Blocked.deleteMany({})
|
|
11
|
-
]);
|
|
12
|
-
|
|
13
|
-
// Create users
|
|
14
|
-
await models.User.insertMany([
|
|
15
|
-
{
|
|
16
|
-
_id: '5cd5308e695db945d3cc81a1',
|
|
17
|
-
firstname: 'John',
|
|
18
|
-
lastname: 'Doe',
|
|
19
|
-
birthdate: '2021-04-02T00:00:00.000Z',
|
|
20
|
-
rating: 4,
|
|
21
|
-
createdAt: '2021-04-02T00:00:00.000Z',
|
|
22
|
-
updatedAt: '2021-04-02T00:00:00.000Z'
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
_id: '5cd5308e695db945d3cc81a2',
|
|
26
|
-
firstname: 'Maria',
|
|
27
|
-
lastname: 'Doe',
|
|
28
|
-
birthdate: '2021-04-02T00:00:00.000Z',
|
|
29
|
-
rating: 5,
|
|
30
|
-
createdAt: '2021-04-02T00:00:00.000Z',
|
|
31
|
-
updatedAt: '2021-04-02T00:00:00.000Z'
|
|
32
|
-
}
|
|
33
|
-
]);
|
|
34
|
-
|
|
35
|
-
// Create cars
|
|
36
|
-
await models.Car.insertMany([
|
|
37
|
-
{
|
|
38
|
-
_id: '5cd5308e695db945d3cc81b1',
|
|
39
|
-
name: 'Porsche 356',
|
|
40
|
-
manufacturer: 'Porsche',
|
|
41
|
-
year: 1948,
|
|
42
|
-
user_id: '5cd5308e695db945d3cc81a1',
|
|
43
|
-
createdAt: "2021-04-02T00:00:00.000Z",
|
|
44
|
-
updatedAt: "2021-04-02T00:00:00.000Z"
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
_id: '5cd5308e695db945d3cc81b2',
|
|
48
|
-
name: 'Porsche 550',
|
|
49
|
-
manufacturer: 'Porsche',
|
|
50
|
-
year: 1953,
|
|
51
|
-
user_id: '5cd5308e695db945d3cc81a2',
|
|
52
|
-
createdAt: "2021-04-02T00:00:00.000Z",
|
|
53
|
-
updatedAt: "2021-04-02T00:00:00.000Z"
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
_id: '5cd5308e695db945d3cc81b3',
|
|
57
|
-
name: 'Porsche 911',
|
|
58
|
-
manufacturer: 'Porsche',
|
|
59
|
-
year: 1963,
|
|
60
|
-
user_id: '5cd5308e695db945d3cc81a1',
|
|
61
|
-
createdAt: "2021-04-02T00:00:00.000Z",
|
|
62
|
-
updatedAt: "2021-04-02T00:00:00.000Z"
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
_id: '5cd5308e695db945d3cc81b4',
|
|
66
|
-
name: 'Porsche 904',
|
|
67
|
-
manufacturer: 'Porsche',
|
|
68
|
-
year: 1964,
|
|
69
|
-
user_id: '5cd5308e695db945d3cc81a2',
|
|
70
|
-
createdAt: "2021-04-02T00:00:00.000Z",
|
|
71
|
-
updatedAt: "2021-04-02T00:00:00.000Z"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
_id: '5cd5308e695db945d3cc81b5',
|
|
75
|
-
name: 'Porsche 906',
|
|
76
|
-
manufacturer: 'Porsche',
|
|
77
|
-
year: 1966,
|
|
78
|
-
user_id: '5cd5308e695db945d3cc81a1',
|
|
79
|
-
createdAt: "2021-04-02T00:00:00.000Z",
|
|
80
|
-
updatedAt: "2021-04-02T00:00:00.000Z"
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
_id: '5cd5308e695db945d3cc81b6',
|
|
84
|
-
name: 'Porsche 908',
|
|
85
|
-
manufacturer: 'Porsche',
|
|
86
|
-
year: 1968,
|
|
87
|
-
user_id: '5cd5308e695db945d3cc81a2',
|
|
88
|
-
createdAt: "2021-04-02T00:00:00.000Z",
|
|
89
|
-
updatedAt: "2021-04-02T00:00:00.000Z"
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
_id: '5cd5308e695db945d3cc81b7',
|
|
93
|
-
name: 'Porsche 914',
|
|
94
|
-
manufacturer: 'Porsche',
|
|
95
|
-
year: 1969,
|
|
96
|
-
user_id: '5cd5308e695db945d3cc81a1',
|
|
97
|
-
createdAt: "2021-04-02T00:00:00.000Z",
|
|
98
|
-
updatedAt: "2021-04-02T00:00:00.000Z"
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
_id: '5cd5308e695db945d3cc81b8',
|
|
102
|
-
name: 'Porsche 917',
|
|
103
|
-
manufacturer: 'Porsche',
|
|
104
|
-
year: 1969,
|
|
105
|
-
user_id: '5cd5308e695db945d3cc81a2',
|
|
106
|
-
createdAt: "2021-04-02T00:00:00.000Z",
|
|
107
|
-
updatedAt: "2021-04-02T00:00:00.000Z"
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
_id: '5cd5308e695db945d3cc81b9',
|
|
111
|
-
name: 'Porsche 924',
|
|
112
|
-
manufacturer: 'Porsche',
|
|
113
|
-
year: 1976,
|
|
114
|
-
user_id: '5cd5308e695db945d3cc81a2',
|
|
115
|
-
createdAt: "2021-04-02T00:00:00.000Z",
|
|
116
|
-
updatedAt: "2021-04-02T00:00:00.000Z"
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
_id: '5cd5308e695db945d3cc81c1',
|
|
120
|
-
name: 'Porsche Macan',
|
|
121
|
-
manufacturer: 'Porsche',
|
|
122
|
-
year: 2014,
|
|
123
|
-
user_id: '5cd5308e695db945d3cc81a2',
|
|
124
|
-
createdAt: "2021-04-02T00:00:00.000Z",
|
|
125
|
-
updatedAt: "2021-04-02T00:00:00.000Z"
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
_id: '5cd5308e695db945d3cc81c2',
|
|
129
|
-
name: 'Ferrari 212 Inter',
|
|
130
|
-
manufacturer: 'Ferrari',
|
|
131
|
-
year: 1951,
|
|
132
|
-
user_id: '5cd5308e695db945d3cc81a1',
|
|
133
|
-
createdAt: "2021-04-02T00:00:00.000Z",
|
|
134
|
-
updatedAt: "2021-04-02T00:00:00.000Z"
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
_id: '5cd5308e695db945d3cc81c3',
|
|
138
|
-
name: 'Ferrari 250 MM',
|
|
139
|
-
manufacturer: 'Ferrari',
|
|
140
|
-
year: 1952,
|
|
141
|
-
user_id: '5cd5308e695db945d3cc81a2',
|
|
142
|
-
createdAt: "2021-04-02T00:00:00.000Z",
|
|
143
|
-
updatedAt: "2021-04-02T00:00:00.000Z"
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
_id: '5cd5308e695db945d3cc81c4',
|
|
147
|
-
name: 'Ferrari 250 GT Coupé',
|
|
148
|
-
manufacturer: 'Ferrari',
|
|
149
|
-
year: 1954,
|
|
150
|
-
user_id: '5cd5308e695db945d3cc81a1',
|
|
151
|
-
createdAt: "2021-04-02T00:00:00.000Z",
|
|
152
|
-
updatedAt: "2021-04-02T00:00:00.000Z"
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
_id: '5cd5308e695db945d3cc81c5',
|
|
156
|
-
name: 'Ferrari 250 GT Berlinetta SWB',
|
|
157
|
-
manufacturer: 'Ferrari',
|
|
158
|
-
year: 1959,
|
|
159
|
-
user_id: '5cd5308e695db945d3cc81a2',
|
|
160
|
-
createdAt: "2021-04-02T00:00:00.000Z",
|
|
161
|
-
updatedAt: "2021-04-02T00:00:00.000Z"
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
_id: '5cd5308e695db945d3cc81c6',
|
|
165
|
-
name: 'Ferrari 250 GT 2+2',
|
|
166
|
-
manufacturer: 'Ferrari',
|
|
167
|
-
year: 1960,
|
|
168
|
-
user_id: '5cd5308e695db945d3cc81a1',
|
|
169
|
-
createdAt: "2021-04-02T00:00:00.000Z",
|
|
170
|
-
updatedAt: "2021-04-02T00:00:00.000Z"
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
_id: '5cd5308e695db945d3cc81c7',
|
|
174
|
-
name: 'Ferrari 250 GTO',
|
|
175
|
-
manufacturer: 'Ferrari',
|
|
176
|
-
year: 1962,
|
|
177
|
-
user_id: '5cd5308e695db945d3cc81a2',
|
|
178
|
-
createdAt: "2021-04-02T00:00:00.000Z",
|
|
179
|
-
updatedAt: "2021-04-02T00:00:00.000Z"
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
_id: '5cd5308e695db945d3cc81c8',
|
|
183
|
-
name: 'Ferrari 250 GT Lusso',
|
|
184
|
-
manufacturer: 'Ferrari',
|
|
185
|
-
year: 1962,
|
|
186
|
-
user_id: '5cd5308e695db945d3cc81a1',
|
|
187
|
-
createdAt: "2021-04-02T00:00:00.000Z",
|
|
188
|
-
updatedAt: "2021-04-02T00:00:00.000Z"
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
_id: '5cd5308e695db945d3cc81c9',
|
|
192
|
-
name: 'Ferrari 488',
|
|
193
|
-
manufacturer: 'Ferrari',
|
|
194
|
-
year: 1969,
|
|
195
|
-
user_id: '5cd5308e695db945d3cc81a2',
|
|
196
|
-
createdAt: "2021-04-02T00:00:00.000Z",
|
|
197
|
-
updatedAt: "2021-04-02T00:00:00.000Z"
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
_id: '5cd5308e695db945d3cc81d1',
|
|
201
|
-
name: 'Ferrari 275',
|
|
202
|
-
manufacturer: 'Ferrari',
|
|
203
|
-
year: 1964,
|
|
204
|
-
user_id: '5cd5308e695db945d3cc81a2',
|
|
205
|
-
createdAt: "2021-04-02T00:00:00.000Z",
|
|
206
|
-
updatedAt: "2021-04-02T00:00:00.000Z"
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
_id: '5cd5308e695db945d3cc81d2',
|
|
210
|
-
name: 'Ferrari 250 LM',
|
|
211
|
-
manufacturer: 'Ferrari',
|
|
212
|
-
year: 1964,
|
|
213
|
-
user_id: '5cd5308e695db945d3cc81a2',
|
|
214
|
-
createdAt: "2021-04-02T00:00:00.000Z",
|
|
215
|
-
updatedAt: "2021-04-02T00:00:00.000Z"
|
|
216
|
-
}
|
|
217
|
-
]);
|
|
218
|
-
|
|
219
|
-
// Create Blocked
|
|
220
|
-
await models.Blocked.insertMany([
|
|
221
|
-
{
|
|
222
|
-
_id: '5cd5308e695db945d3cc81c1',
|
|
223
|
-
blocked_id: '5cd5308e695db945d3cc81a1',
|
|
224
|
-
blocked_model: 'User'
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
_id: '5cd5308e695db945d3cc81c2',
|
|
228
|
-
blocked_id: '5cd5308e695db945d3cc81b1',
|
|
229
|
-
blocked_model: 'Car'
|
|
230
|
-
}
|
|
231
|
-
]);
|
|
232
|
-
|
|
233
|
-
console.log('Done!');
|
|
234
|
-
});
|
package/models/blocked.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const mongoose = require('mongoose');
|
|
2
|
-
const Schema = mongoose.Schema;
|
|
3
|
-
|
|
4
|
-
const BlockedSchema = new Schema({
|
|
5
|
-
blocked_id: {
|
|
6
|
-
type: Schema.Types.ObjectId,
|
|
7
|
-
required: true,
|
|
8
|
-
refPath: 'blocked_model'
|
|
9
|
-
},
|
|
10
|
-
blocked_model: {
|
|
11
|
-
type: String,
|
|
12
|
-
required: true,
|
|
13
|
-
enum: ['User', 'Car']
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
module.exports = mongoose.model('Blocked', BlockedSchema, 'blocked');
|
package/models/car.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
const mongoose = require('mongoose');
|
|
2
|
-
const Schema = mongoose.Schema;
|
|
3
|
-
|
|
4
|
-
const CarSchema = new Schema({
|
|
5
|
-
user_id: {
|
|
6
|
-
type: Schema.Types.ObjectId,
|
|
7
|
-
ref: 'User'
|
|
8
|
-
},
|
|
9
|
-
name: {
|
|
10
|
-
type: String
|
|
11
|
-
},
|
|
12
|
-
manufacturer: {
|
|
13
|
-
type: String
|
|
14
|
-
},
|
|
15
|
-
year: {
|
|
16
|
-
type: Number
|
|
17
|
-
},
|
|
18
|
-
createdAt: {
|
|
19
|
-
type: Date
|
|
20
|
-
},
|
|
21
|
-
updatedAt: {
|
|
22
|
-
type: Date
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
module.exports = mongoose.model('Car', CarSchema, 'cars');
|
package/models/user.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
const mongoose = require('mongoose');
|
|
2
|
-
const Schema = mongoose.Schema;
|
|
3
|
-
|
|
4
|
-
const UserSchema = new Schema({
|
|
5
|
-
firstname: {
|
|
6
|
-
type: String
|
|
7
|
-
},
|
|
8
|
-
lastname: {
|
|
9
|
-
type: String
|
|
10
|
-
},
|
|
11
|
-
birthdate: {
|
|
12
|
-
type: Date
|
|
13
|
-
},
|
|
14
|
-
rating: {
|
|
15
|
-
type: Number
|
|
16
|
-
},
|
|
17
|
-
createdAt: {
|
|
18
|
-
type: Date
|
|
19
|
-
},
|
|
20
|
-
updatedAt: {
|
|
21
|
-
type: Date
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
module.exports = mongoose.model('User', UserSchema, 'users');
|
|
@@ -1,389 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`Bar/Lines chart - Simple day 1`] = `
|
|
4
|
-
Object {
|
|
5
|
-
"chart": Object {
|
|
6
|
-
"config": Object {
|
|
7
|
-
"xaxis": Array [
|
|
8
|
-
Object {
|
|
9
|
-
"dataKey": "key",
|
|
10
|
-
},
|
|
11
|
-
],
|
|
12
|
-
"yaxis": Array [
|
|
13
|
-
Object {
|
|
14
|
-
"dataKey": "value",
|
|
15
|
-
},
|
|
16
|
-
],
|
|
17
|
-
},
|
|
18
|
-
"data": Array [
|
|
19
|
-
Object {
|
|
20
|
-
"key": "04/10",
|
|
21
|
-
"value": 0,
|
|
22
|
-
},
|
|
23
|
-
Object {
|
|
24
|
-
"key": "05/10",
|
|
25
|
-
"value": 0,
|
|
26
|
-
},
|
|
27
|
-
Object {
|
|
28
|
-
"key": "06/10",
|
|
29
|
-
"value": 0,
|
|
30
|
-
},
|
|
31
|
-
Object {
|
|
32
|
-
"key": "07/10",
|
|
33
|
-
"value": 0,
|
|
34
|
-
},
|
|
35
|
-
Object {
|
|
36
|
-
"key": "08/10",
|
|
37
|
-
"value": 0,
|
|
38
|
-
},
|
|
39
|
-
Object {
|
|
40
|
-
"key": "09/10",
|
|
41
|
-
"value": 0,
|
|
42
|
-
},
|
|
43
|
-
Object {
|
|
44
|
-
"key": "10/10",
|
|
45
|
-
"value": 0,
|
|
46
|
-
},
|
|
47
|
-
Object {
|
|
48
|
-
"key": "11/10",
|
|
49
|
-
"value": 0,
|
|
50
|
-
},
|
|
51
|
-
Object {
|
|
52
|
-
"key": "12/10",
|
|
53
|
-
"value": 0,
|
|
54
|
-
},
|
|
55
|
-
Object {
|
|
56
|
-
"key": "13/10",
|
|
57
|
-
"value": 0,
|
|
58
|
-
},
|
|
59
|
-
Object {
|
|
60
|
-
"key": "14/10",
|
|
61
|
-
"value": 0,
|
|
62
|
-
},
|
|
63
|
-
Object {
|
|
64
|
-
"key": "15/10",
|
|
65
|
-
"value": 0,
|
|
66
|
-
},
|
|
67
|
-
Object {
|
|
68
|
-
"key": "16/10",
|
|
69
|
-
"value": 0,
|
|
70
|
-
},
|
|
71
|
-
Object {
|
|
72
|
-
"key": "17/10",
|
|
73
|
-
"value": 0,
|
|
74
|
-
},
|
|
75
|
-
Object {
|
|
76
|
-
"key": "18/10",
|
|
77
|
-
"value": 0,
|
|
78
|
-
},
|
|
79
|
-
Object {
|
|
80
|
-
"key": "19/10",
|
|
81
|
-
"value": 0,
|
|
82
|
-
},
|
|
83
|
-
Object {
|
|
84
|
-
"key": "20/10",
|
|
85
|
-
"value": 0,
|
|
86
|
-
},
|
|
87
|
-
Object {
|
|
88
|
-
"key": "21/10",
|
|
89
|
-
"value": 0,
|
|
90
|
-
},
|
|
91
|
-
Object {
|
|
92
|
-
"key": "22/10",
|
|
93
|
-
"value": 0,
|
|
94
|
-
},
|
|
95
|
-
Object {
|
|
96
|
-
"key": "23/10",
|
|
97
|
-
"value": 0,
|
|
98
|
-
},
|
|
99
|
-
Object {
|
|
100
|
-
"key": "24/10",
|
|
101
|
-
"value": 0,
|
|
102
|
-
},
|
|
103
|
-
Object {
|
|
104
|
-
"key": "25/10",
|
|
105
|
-
"value": 0,
|
|
106
|
-
},
|
|
107
|
-
Object {
|
|
108
|
-
"key": "26/10",
|
|
109
|
-
"value": 0,
|
|
110
|
-
},
|
|
111
|
-
Object {
|
|
112
|
-
"key": "27/10",
|
|
113
|
-
"value": 0,
|
|
114
|
-
},
|
|
115
|
-
Object {
|
|
116
|
-
"key": "28/10",
|
|
117
|
-
"value": 0,
|
|
118
|
-
},
|
|
119
|
-
Object {
|
|
120
|
-
"key": "29/10",
|
|
121
|
-
"value": 0,
|
|
122
|
-
},
|
|
123
|
-
Object {
|
|
124
|
-
"key": "30/10",
|
|
125
|
-
"value": 0,
|
|
126
|
-
},
|
|
127
|
-
Object {
|
|
128
|
-
"key": "31/10",
|
|
129
|
-
"value": 0,
|
|
130
|
-
},
|
|
131
|
-
Object {
|
|
132
|
-
"key": "01/11",
|
|
133
|
-
"value": 0,
|
|
134
|
-
},
|
|
135
|
-
Object {
|
|
136
|
-
"key": "02/11",
|
|
137
|
-
"value": 0,
|
|
138
|
-
},
|
|
139
|
-
],
|
|
140
|
-
},
|
|
141
|
-
}
|
|
142
|
-
`;
|
|
143
|
-
|
|
144
|
-
exports[`Bar/Lines chart - Simple month 1`] = `
|
|
145
|
-
Object {
|
|
146
|
-
"chart": Object {
|
|
147
|
-
"config": Object {
|
|
148
|
-
"xaxis": Array [
|
|
149
|
-
Object {
|
|
150
|
-
"dataKey": "key",
|
|
151
|
-
},
|
|
152
|
-
],
|
|
153
|
-
"yaxis": Array [
|
|
154
|
-
Object {
|
|
155
|
-
"dataKey": "value",
|
|
156
|
-
},
|
|
157
|
-
],
|
|
158
|
-
},
|
|
159
|
-
"data": Array [
|
|
160
|
-
Object {
|
|
161
|
-
"key": "Nov",
|
|
162
|
-
"value": 0,
|
|
163
|
-
},
|
|
164
|
-
Object {
|
|
165
|
-
"key": "Dec",
|
|
166
|
-
"value": 0,
|
|
167
|
-
},
|
|
168
|
-
Object {
|
|
169
|
-
"key": "Jan",
|
|
170
|
-
"value": 0,
|
|
171
|
-
},
|
|
172
|
-
Object {
|
|
173
|
-
"key": "Feb",
|
|
174
|
-
"value": 0,
|
|
175
|
-
},
|
|
176
|
-
Object {
|
|
177
|
-
"key": "Mar",
|
|
178
|
-
"value": 0,
|
|
179
|
-
},
|
|
180
|
-
Object {
|
|
181
|
-
"key": "Apr",
|
|
182
|
-
"value": 2,
|
|
183
|
-
},
|
|
184
|
-
Object {
|
|
185
|
-
"key": "May",
|
|
186
|
-
"value": 0,
|
|
187
|
-
},
|
|
188
|
-
Object {
|
|
189
|
-
"key": "Jun",
|
|
190
|
-
"value": 0,
|
|
191
|
-
},
|
|
192
|
-
Object {
|
|
193
|
-
"key": "Jul",
|
|
194
|
-
"value": 0,
|
|
195
|
-
},
|
|
196
|
-
Object {
|
|
197
|
-
"key": "Aug",
|
|
198
|
-
"value": 0,
|
|
199
|
-
},
|
|
200
|
-
Object {
|
|
201
|
-
"key": "Sep",
|
|
202
|
-
"value": 0,
|
|
203
|
-
},
|
|
204
|
-
Object {
|
|
205
|
-
"key": "Oct",
|
|
206
|
-
"value": 0,
|
|
207
|
-
},
|
|
208
|
-
],
|
|
209
|
-
},
|
|
210
|
-
}
|
|
211
|
-
`;
|
|
212
|
-
|
|
213
|
-
exports[`Bar/Lines chart - Simple week 1`] = `
|
|
214
|
-
Object {
|
|
215
|
-
"chart": Object {
|
|
216
|
-
"config": Object {
|
|
217
|
-
"xaxis": Array [
|
|
218
|
-
Object {
|
|
219
|
-
"dataKey": "key",
|
|
220
|
-
},
|
|
221
|
-
],
|
|
222
|
-
"yaxis": Array [
|
|
223
|
-
Object {
|
|
224
|
-
"dataKey": "value",
|
|
225
|
-
},
|
|
226
|
-
],
|
|
227
|
-
},
|
|
228
|
-
"data": Array [
|
|
229
|
-
Object {
|
|
230
|
-
"key": "02/05",
|
|
231
|
-
"value": 0,
|
|
232
|
-
},
|
|
233
|
-
Object {
|
|
234
|
-
"key": "09/05",
|
|
235
|
-
"value": 0,
|
|
236
|
-
},
|
|
237
|
-
Object {
|
|
238
|
-
"key": "16/05",
|
|
239
|
-
"value": 0,
|
|
240
|
-
},
|
|
241
|
-
Object {
|
|
242
|
-
"key": "23/05",
|
|
243
|
-
"value": 0,
|
|
244
|
-
},
|
|
245
|
-
Object {
|
|
246
|
-
"key": "30/05",
|
|
247
|
-
"value": 0,
|
|
248
|
-
},
|
|
249
|
-
Object {
|
|
250
|
-
"key": "06/06",
|
|
251
|
-
"value": 0,
|
|
252
|
-
},
|
|
253
|
-
Object {
|
|
254
|
-
"key": "13/06",
|
|
255
|
-
"value": 0,
|
|
256
|
-
},
|
|
257
|
-
Object {
|
|
258
|
-
"key": "20/06",
|
|
259
|
-
"value": 0,
|
|
260
|
-
},
|
|
261
|
-
Object {
|
|
262
|
-
"key": "27/06",
|
|
263
|
-
"value": 0,
|
|
264
|
-
},
|
|
265
|
-
Object {
|
|
266
|
-
"key": "04/07",
|
|
267
|
-
"value": 0,
|
|
268
|
-
},
|
|
269
|
-
Object {
|
|
270
|
-
"key": "11/07",
|
|
271
|
-
"value": 0,
|
|
272
|
-
},
|
|
273
|
-
Object {
|
|
274
|
-
"key": "18/07",
|
|
275
|
-
"value": 0,
|
|
276
|
-
},
|
|
277
|
-
Object {
|
|
278
|
-
"key": "25/07",
|
|
279
|
-
"value": 0,
|
|
280
|
-
},
|
|
281
|
-
Object {
|
|
282
|
-
"key": "01/08",
|
|
283
|
-
"value": 0,
|
|
284
|
-
},
|
|
285
|
-
Object {
|
|
286
|
-
"key": "08/08",
|
|
287
|
-
"value": 0,
|
|
288
|
-
},
|
|
289
|
-
Object {
|
|
290
|
-
"key": "15/08",
|
|
291
|
-
"value": 0,
|
|
292
|
-
},
|
|
293
|
-
Object {
|
|
294
|
-
"key": "22/08",
|
|
295
|
-
"value": 0,
|
|
296
|
-
},
|
|
297
|
-
Object {
|
|
298
|
-
"key": "29/08",
|
|
299
|
-
"value": 0,
|
|
300
|
-
},
|
|
301
|
-
Object {
|
|
302
|
-
"key": "05/09",
|
|
303
|
-
"value": 0,
|
|
304
|
-
},
|
|
305
|
-
Object {
|
|
306
|
-
"key": "12/09",
|
|
307
|
-
"value": 0,
|
|
308
|
-
},
|
|
309
|
-
Object {
|
|
310
|
-
"key": "19/09",
|
|
311
|
-
"value": 0,
|
|
312
|
-
},
|
|
313
|
-
Object {
|
|
314
|
-
"key": "26/09",
|
|
315
|
-
"value": 0,
|
|
316
|
-
},
|
|
317
|
-
Object {
|
|
318
|
-
"key": "03/10",
|
|
319
|
-
"value": 0,
|
|
320
|
-
},
|
|
321
|
-
Object {
|
|
322
|
-
"key": "10/10",
|
|
323
|
-
"value": 0,
|
|
324
|
-
},
|
|
325
|
-
Object {
|
|
326
|
-
"key": "17/10",
|
|
327
|
-
"value": 0,
|
|
328
|
-
},
|
|
329
|
-
Object {
|
|
330
|
-
"key": "24/10",
|
|
331
|
-
"value": 0,
|
|
332
|
-
},
|
|
333
|
-
],
|
|
334
|
-
},
|
|
335
|
-
}
|
|
336
|
-
`;
|
|
337
|
-
|
|
338
|
-
exports[`Bar/Lines chart - Simple year 1`] = `
|
|
339
|
-
Object {
|
|
340
|
-
"chart": Object {
|
|
341
|
-
"config": Object {
|
|
342
|
-
"xaxis": Array [
|
|
343
|
-
Object {
|
|
344
|
-
"dataKey": "key",
|
|
345
|
-
},
|
|
346
|
-
],
|
|
347
|
-
"yaxis": Array [
|
|
348
|
-
Object {
|
|
349
|
-
"dataKey": "value",
|
|
350
|
-
},
|
|
351
|
-
],
|
|
352
|
-
},
|
|
353
|
-
"data": Array [
|
|
354
|
-
Object {
|
|
355
|
-
"key": "2013",
|
|
356
|
-
"value": 0,
|
|
357
|
-
},
|
|
358
|
-
Object {
|
|
359
|
-
"key": "2014",
|
|
360
|
-
"value": 0,
|
|
361
|
-
},
|
|
362
|
-
Object {
|
|
363
|
-
"key": "2015",
|
|
364
|
-
"value": 0,
|
|
365
|
-
},
|
|
366
|
-
Object {
|
|
367
|
-
"key": "2016",
|
|
368
|
-
"value": 0,
|
|
369
|
-
},
|
|
370
|
-
Object {
|
|
371
|
-
"key": "2017",
|
|
372
|
-
"value": 0,
|
|
373
|
-
},
|
|
374
|
-
Object {
|
|
375
|
-
"key": "2018",
|
|
376
|
-
"value": 0,
|
|
377
|
-
},
|
|
378
|
-
Object {
|
|
379
|
-
"key": "2019",
|
|
380
|
-
"value": 0,
|
|
381
|
-
},
|
|
382
|
-
Object {
|
|
383
|
-
"key": "2020",
|
|
384
|
-
"value": 0,
|
|
385
|
-
},
|
|
386
|
-
],
|
|
387
|
-
},
|
|
388
|
-
}
|
|
389
|
-
`;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`Pie chart - Count 1`] = `
|
|
4
|
-
Object {
|
|
5
|
-
"chart": Object {
|
|
6
|
-
"config": null,
|
|
7
|
-
"data": Array [
|
|
8
|
-
Object {
|
|
9
|
-
"key": 4,
|
|
10
|
-
"value": 1,
|
|
11
|
-
},
|
|
12
|
-
Object {
|
|
13
|
-
"key": 5,
|
|
14
|
-
"value": 1,
|
|
15
|
-
},
|
|
16
|
-
],
|
|
17
|
-
},
|
|
18
|
-
}
|
|
19
|
-
`;
|