gw2e-account-statistics 3.4.2 → 3.5.1

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.
@@ -0,0 +1,932 @@
1
+ /* eslint-env node, mocha */
2
+ import { expect } from 'chai'
3
+ import itemsStatistics from '../src/statistics/items'
4
+
5
+ const generateAccount = (items) => {
6
+ return {
7
+ bank: items.slice(0, 1),
8
+ characters: [{
9
+ name: 'Holds items',
10
+ equipment: [],
11
+ bags: [
12
+ {inventory: items.slice(1)}
13
+ ]
14
+ }]
15
+ }
16
+ }
17
+
18
+ describe('statistics > items', () => {
19
+ it('exits out when one of the permissions is missing', () => {
20
+ const emptyObject = {
21
+ baubleInfusions: null,
22
+ brokenSpoons: null,
23
+ shinyBaubles: null,
24
+ chakEggSacks: null,
25
+ fractalTonics: null,
26
+ ghostlyInfusions: null,
27
+ legendaryItems: null,
28
+ legendaryItemsWeapon: null,
29
+ legendaryItemsArmor: null,
30
+ legendaryItemsBack: null,
31
+ legendaryItemsTrinket: null,
32
+ luminescentRefractors: null,
33
+ preservedQueenBees: null,
34
+ permanentTools: null,
35
+ whiteMantlePortalDevices: null,
36
+ blackLionClaimTickets: null,
37
+ instruments: null,
38
+ fishItems: null,
39
+ fishItemsLegendary: null,
40
+ fishItemsAscended: null,
41
+ fishItemsExotic: null,
42
+ fishItemsRare: null,
43
+ fishItemsMasterwork: null,
44
+ fishItemsFine: null,
45
+ fishItemsBasic: null,
46
+ fishItemsJunk: null,
47
+ musicBoxes: null,
48
+ chakEggs: null,
49
+ fossilizedInsects: null,
50
+ reclaimedMetalPlates: null,
51
+ championBags: null,
52
+ tripleTroubleChests: null,
53
+ tequatlChests: null,
54
+ vbHerosChoice: null,
55
+ tdHerosChoice: null,
56
+ abHerosChoice: null,
57
+ dsHerosChoice: null,
58
+ crystalOasisHerosChoice: null,
59
+ elonRiverlandsHerosChoice: null,
60
+ theDesolationHerosChoice: null,
61
+ domainOfVabbiHerosChoice: null,
62
+ uniqueTonics: null,
63
+ bloodRubies: null,
64
+ petrifiedWood: null,
65
+ tomesOfKnowledge: null,
66
+ permanentContracts: null,
67
+ freshWinterberries: null,
68
+ wintersHeartInfusions: null,
69
+ kodasWarmthEnrichment: null,
70
+ phospholuminescentInfusions: null,
71
+ gemstoreToys: null,
72
+ blackLionMiniatureClaimTickets: null,
73
+ jadeShards: null,
74
+ giftsOfExploration: null,
75
+ giftsOfBattle: null,
76
+ dragoniteOre: null,
77
+ bloodstoneDust: null,
78
+ empyrealFragments: null,
79
+ crystallineOre: null,
80
+ airshipOil: null,
81
+ auricDust: null,
82
+ leyLineSparks: null,
83
+ _luckFromItems: null,
84
+ legendarySpikes: null,
85
+ fireOrchidBlossoms: null,
86
+ orrianPearls: null,
87
+ liquidAurillium: null,
88
+ celestialInfusion: null,
89
+ celestialInfusionRed: null,
90
+ celestialInfusionBlue: null,
91
+ frostLegionInfusion: null,
92
+ abyssalInfusion: null,
93
+ ottersBlessingEnrichment: null,
94
+ celebratoryBirthdayEnrichment: null,
95
+ festiveConfettiInfusions: null,
96
+ emberInfusions: null,
97
+ mysticInfusions: null,
98
+ peerlessInfusions: null,
99
+ toyShellInfusions: null,
100
+ kralkatiteOre: null,
101
+ potionOfPvpRewards: null,
102
+ potionOfWvwRewards: null,
103
+ skirmishChests: null,
104
+ difluoriteCrystals: null,
105
+ eitriteIngots: null,
106
+ kites: null,
107
+ snowDiamondInfusions: null,
108
+ inscribedShards: null,
109
+ lumpsOfMistonium: null,
110
+ brandedMass: null,
111
+ mistbornMote: null,
112
+ hatchedChili: null,
113
+ eternalIceShard: null,
114
+ crystalInfusions: null,
115
+ polysaturatingInfusions: null,
116
+ silverwastesShovels: null,
117
+ thirtyTwoSlotBags: null,
118
+ flyingCowTokens: null,
119
+ heartOfTheKhanUr: null,
120
+ brokenTwig: null,
121
+ warmStone: null,
122
+ crumblingBone: null,
123
+ mangledTalon: null,
124
+ clumpOfResin: null,
125
+ emblemOfTheAvenger: null,
126
+ emblemOfTheConqueror: null,
127
+ emblemOfTournamentVictory: null,
128
+ emblemOfVictory: null,
129
+ _unstableFractalEssenceFromItems: null,
130
+ chestOfDungeoneering: null,
131
+ deldrimorStoneskinInfusions: null,
132
+ jormagEyeInfusions: null,
133
+ primordusEyeInfusions: null,
134
+ _legendaryInsightsFromItems: null,
135
+ _legendaryDivinationsFromItems: null
136
+ }
137
+
138
+ const bothPermissions = {bank: null, characters: null}
139
+ expect(itemsStatistics(bothPermissions)).to.deep.equal(emptyObject)
140
+
141
+ const inventoriesPermission = {bank: null, characters: [{name: 'Yo'}]}
142
+ expect(itemsStatistics(inventoriesPermission)).to.deep.equal(emptyObject)
143
+
144
+ const charactersPermission = {bank: [{id: 30687}], characters: null}
145
+ expect(itemsStatistics(charactersPermission)).to.deep.equal(emptyObject)
146
+ })
147
+
148
+ it('can calculate legendary count', () => {
149
+ const account = generateAccount([
150
+ {id: 123, count: 1},
151
+ {id: 30687, count: 1}, // 1
152
+ {id: 71383, count: 1}, // 2
153
+ {id: 1, count: 1},
154
+ {id: 80205, count: 1}, // 3
155
+ {id: 77474, count: 1} // 4
156
+ ])
157
+
158
+ account.characters[0].last_modified = new Date('2021-07-24T12:00:00.000Z')
159
+ account.characters[0].equipment = [
160
+ {id: 80205},
161
+ {id: 71383, location: 'EquippedFromLegendaryArmory'}
162
+ ] // Ignored
163
+
164
+ account.legendaryarmory = [{id: 80205, count: 2}] // 5 + 6
165
+
166
+ expect(itemsStatistics(account).legendaryItems).to.equal(6)
167
+ })
168
+
169
+ it('can calculate legendary weapon count', () => {
170
+ expect(itemsStatistics(generateAccount([
171
+ {id: 123, count: 1},
172
+ {id: 30687, count: 1},
173
+ {id: 71383, count: 1},
174
+ {id: 1, count: 1},
175
+ {id: 7, count: 1},
176
+ {id: 77474, count: 1}
177
+ ])).legendaryItemsWeapon).to.equal(2)
178
+ })
179
+
180
+ it('can calculate legendary armor count', () => {
181
+ expect(itemsStatistics(generateAccount([
182
+ {id: 123, count: 1},
183
+ {id: 80254, count: 1},
184
+ {id: 80277, count: 1},
185
+ {id: 1, count: 1},
186
+ {id: 7, count: 1},
187
+ {id: 77474, count: 1}
188
+ ])).legendaryItemsArmor).to.equal(2)
189
+ })
190
+
191
+ it('can calculate legendary back count', () => {
192
+ expect(itemsStatistics(generateAccount([
193
+ {id: 123, count: 1},
194
+ {id: 74155, count: 1},
195
+ {id: 80277, count: 1},
196
+ {id: 1, count: 1},
197
+ {id: 30704, count: 1},
198
+ {id: 77474, count: 1}
199
+ ])).legendaryItemsBack).to.equal(2)
200
+ })
201
+
202
+ it('can calculate legendary trinket count', () => {
203
+ expect(itemsStatistics(generateAccount([
204
+ {id: 123, count: 1},
205
+ {id: 74155, count: 1},
206
+ {id: 80277, count: 1},
207
+ {id: 1, count: 1},
208
+ {id: 81908, count: 1},
209
+ {id: 77474, count: 1}
210
+ ])).legendaryItemsTrinket).to.equal(1)
211
+ })
212
+
213
+ it('can calculate fractal tonic count', () => {
214
+ expect(itemsStatistics(generateAccount([
215
+ {id: 49277, count: 1},
216
+ {id: 30687, count: 1},
217
+ {id: 71383, count: 1},
218
+ {id: 49277, count: 1},
219
+ {id: 49277, count: 1}
220
+ ])).fractalTonics).to.equal(3)
221
+ })
222
+
223
+ it('can calculate legendary insight count', () => {
224
+ const items = {
225
+ // Heavy Ascended
226
+ RefinedEnvoyHelmet: 80387,
227
+ RefinedEnvoyPauldrons: 80236,
228
+ RefinedEnvoyBreastplate: 80648,
229
+ RefinedEnvoyGauntlets: 80673,
230
+ RefinedEnvoyTassets: 80427,
231
+ RefinedEnvoyGreaves: 80127,
232
+
233
+ // Medium Ascended
234
+ RefinedEnvoyMask: 80634,
235
+ RefinedEnvoyShoulderpads: 80366,
236
+ RefinedEnvoyJerkin: 80607,
237
+ RefinedEnvoyVambraces: 80658,
238
+ RefinedEnvoyLeggings: 80675,
239
+ RefinedEnvoyBoots: 80177,
240
+
241
+ // Light Ascended
242
+ RefinedEnvoyCowl: 80441,
243
+ RefinedEnvoyMantle: 80264,
244
+ RefinedEnvoyVestments: 80120,
245
+ RefinedEnvoyGloves: 80460,
246
+ RefinedEnvoyPants: 80275,
247
+ RefinedEnvoyShoes: 80583,
248
+
249
+ // Heavy Legendary
250
+ PerfectedEnvoyHelmet: 80384,
251
+ PerfectedEnvoyPauldrons: 80435,
252
+ PerfectedEnvoyBreastplate: 80254,
253
+ PerfectedEnvoyGauntlets: 80205,
254
+ PerfectedEnvoyTassets: 80277,
255
+ PerfectedEnvoyGreaves: 80557,
256
+
257
+ // Medium Legendary
258
+ PerfectedEnvoyMask: 80296,
259
+ PerfectedEnvoyShoulderpads: 80145,
260
+ PerfectedEnvoyJerkin: 80578,
261
+ PerfectedEnvoyVambraces: 80161,
262
+ PerfectedEnvoyLeggings: 80252,
263
+ PerfectedEnvoyBoots: 80281,
264
+
265
+ // Light Legendary
266
+ PerfectedEnvoyCowl: 80248,
267
+ PerfectedEnvoyMantle: 80131,
268
+ PerfectedEnvoyVestments: 80190,
269
+ PerfectedEnvoyGloves: 80111,
270
+ PerfectedEnvoyPants: 80356,
271
+ PerfectedEnvoyShoes: 80399
272
+ }
273
+
274
+ function countFromList (itemList) {
275
+ const account = generateAccount(itemList.map(id => ({id, count: 1})))
276
+ return itemsStatistics(account)._legendaryInsightsFromItems
277
+ }
278
+
279
+ // Count the basic items
280
+ expect(itemsStatistics(generateAccount([
281
+ {id: 80516, count: 3}, // Envoy Insignia => 25 each
282
+ {id: 78989, count: 1}, // Gift of Prowess => 25 each
283
+ {id: 77302, count: 7} // Legendary Insight => 1 each
284
+ ]))._legendaryInsightsFromItems, 'basic items').to.equal(3 * 25 + 25 + 7)
285
+
286
+ // Count the full first ascended set (from the achievement, so no LI spent)
287
+ const oneWeightAscendedSet = [
288
+ items.RefinedEnvoyHelmet, items.RefinedEnvoyPauldrons, items.RefinedEnvoyBreastplate,
289
+ items.RefinedEnvoyGauntlets, items.RefinedEnvoyTassets, items.RefinedEnvoyGreaves
290
+ ]
291
+ expect(countFromList(oneWeightAscendedSet), 'oneWeightAscendedSet')
292
+ .to.equal(0)
293
+
294
+ // Count the full first ascended set (from the achievement, so no LI spent)
295
+ // and some extra ascended items that got crafted via 25 LI insignias
296
+ const oneWeightAscendedSetPlusExtra = [
297
+ items.RefinedEnvoyHelmet, items.RefinedEnvoyPauldrons, items.RefinedEnvoyBreastplate,
298
+ items.RefinedEnvoyGauntlets, items.RefinedEnvoyTassets, items.RefinedEnvoyGreaves,
299
+ items.RefinedEnvoyHelmet, items.RefinedEnvoyCowl // one of the same weight, one in a different one
300
+ ]
301
+ expect(countFromList(oneWeightAscendedSetPlusExtra), 'oneWeightAscendedSetPlusExtra')
302
+ .to.equal(25 + 25)
303
+
304
+ // Count all first ascended sets (one from the achievement, so no LI spent and two for 25/each)
305
+ const allAscendedSets = [
306
+ items.RefinedEnvoyHelmet, items.RefinedEnvoyPauldrons, items.RefinedEnvoyBreastplate,
307
+ items.RefinedEnvoyGauntlets, items.RefinedEnvoyTassets, items.RefinedEnvoyGreaves,
308
+
309
+ items.RefinedEnvoyMask, items.RefinedEnvoyShoulderpads, items.RefinedEnvoyJerkin,
310
+ items.RefinedEnvoyVambraces, items.RefinedEnvoyLeggings, items.RefinedEnvoyBoots,
311
+
312
+ items.RefinedEnvoyCowl, items.RefinedEnvoyMantle, items.RefinedEnvoyVestments,
313
+ items.RefinedEnvoyGloves, items.RefinedEnvoyPants, items.RefinedEnvoyShoes
314
+ ]
315
+ expect(countFromList(allAscendedSets), 'allAscendedSets')
316
+ .to.equal(2 * 6 * 25)
317
+
318
+ // Count the full first legendary set (the precursor was from the achievement, so no LI spent)
319
+ // but the ascended -> legendary conversion costs 25
320
+ const oneWeightLegendarySet = [
321
+ items.PerfectedEnvoyHelmet, items.PerfectedEnvoyPauldrons, items.PerfectedEnvoyBreastplate,
322
+ items.PerfectedEnvoyGauntlets, items.PerfectedEnvoyTassets, items.PerfectedEnvoyGreaves
323
+ ]
324
+ expect(countFromList(oneWeightLegendarySet), 'oneWeightLegendarySet')
325
+ .to.equal(6 * 25)
326
+
327
+ // Count the full first legendary set (the precursor was from the achievement, so no LI spent)
328
+ // but the ascended -> legendary conversion costs 25 and some extra ascended items that got crafted via 25 LI insignias
329
+ const oneWeightLegendarySetSetPlusExtraAscended = [
330
+ items.PerfectedEnvoyHelmet, items.PerfectedEnvoyPauldrons, items.PerfectedEnvoyBreastplate,
331
+ items.PerfectedEnvoyGauntlets, items.PerfectedEnvoyTassets, items.PerfectedEnvoyGreaves,
332
+ items.RefinedEnvoyHelmet, items.RefinedEnvoyCowl // one of the same weight, one in a different one
333
+ ]
334
+ expect(countFromList(oneWeightLegendarySetSetPlusExtraAscended), 'oneWeightLegendarySetSetPlusExtraAscended')
335
+ .to.equal(6 * 25 + 25 + 25)
336
+
337
+ // Count the full first legendary set (the precursor was from the achievement, so no LI spent)
338
+ // but the ascended -> legendary conversion costs 25 and some extra ascended items that got crafted via 25 LI insignias
339
+ // and some extra legendary items that got crafted (25 for the precursor and 25 for the conversion)
340
+ const oneWeightLegendarySetPlusExtraLegendary = [
341
+ items.PerfectedEnvoyHelmet, items.PerfectedEnvoyPauldrons, items.PerfectedEnvoyBreastplate,
342
+ items.PerfectedEnvoyGauntlets, items.PerfectedEnvoyTassets, items.PerfectedEnvoyGreaves,
343
+ items.RefinedEnvoyHelmet, items.RefinedEnvoyCowl, // one of the same weight, one in a different one
344
+ items.PerfectedEnvoyHelmet, items.PerfectedEnvoyCowl // one of the same weight, one in a different one
345
+ ]
346
+ expect(countFromList(oneWeightLegendarySetPlusExtraLegendary), 'oneWeightLegendarySetPlusExtraLegendary').to.equal(
347
+ 6 * 25 + // First set, where the precursor was free
348
+ 25 + 25 + // Extra refined items, 25 each
349
+ 50 + 50 // Extra perfected items, 50 each
350
+ )
351
+
352
+ // Count the full first legendary set (one of the precursor sets was from the achievement, so no LI spent)
353
+ // but the ascended -> legendary conversion costs 25 and the second set costs 25 extra for the precursor
354
+ const allLegendarySets = [
355
+ items.PerfectedEnvoyHelmet, items.PerfectedEnvoyPauldrons, items.PerfectedEnvoyBreastplate,
356
+ items.PerfectedEnvoyGauntlets, items.PerfectedEnvoyTassets, items.PerfectedEnvoyGreaves,
357
+
358
+ items.PerfectedEnvoyMask, items.PerfectedEnvoyShoulderpads, items.PerfectedEnvoyJerkin,
359
+ items.PerfectedEnvoyVambraces, items.PerfectedEnvoyLeggings, items.PerfectedEnvoyBoots,
360
+
361
+ items.PerfectedEnvoyCowl, items.PerfectedEnvoyMantle, items.PerfectedEnvoyVestments,
362
+ items.PerfectedEnvoyGloves, items.PerfectedEnvoyPants, items.PerfectedEnvoyShoes,
363
+
364
+ items.RefinedEnvoyHelmet, items.RefinedEnvoyCowl, // extra refined items
365
+ items.PerfectedEnvoyHelmet, items.PerfectedEnvoyCowl // extra perfected items
366
+ ]
367
+ expect(countFromList(allLegendarySets), 'allLegendarySets').to.equal(
368
+ 6 * 25 + // First set, where the precursor was free
369
+ 2 * 6 * (25 + 25) + // Second and third set, where the precursor was 25 LI
370
+ 25 + 25 + // Extra refined items, 25 each
371
+ 50 + 50 // Extra perfected items, 50 each
372
+ )
373
+ })
374
+
375
+ it('can calculate white mantle portal device count', () => {
376
+ expect(itemsStatistics(generateAccount([
377
+ {id: 78978, count: 1},
378
+ {id: 30687, count: 1},
379
+ {id: 71383, count: 1},
380
+ {id: 78978, count: 1},
381
+ {id: 78978, count: 1}
382
+ ])).whiteMantlePortalDevices).to.equal(3)
383
+ })
384
+
385
+ it('can calculate chak egg sack count', () => {
386
+ expect(itemsStatistics(generateAccount([
387
+ {id: 72021, count: 1},
388
+ {id: 30687, count: 1},
389
+ {id: 71383, count: 1},
390
+ {id: 72021, count: 1},
391
+ {id: 72021, count: 1}
392
+ ])).chakEggSacks).to.equal(3)
393
+ })
394
+
395
+ it('can calculate preserved queen bee count', () => {
396
+ expect(itemsStatistics(generateAccount([
397
+ {id: 68440, count: 1},
398
+ {id: 30687, count: 1},
399
+ {id: 71383, count: 1},
400
+ {id: 68440, count: 1},
401
+ {id: 68440, count: 1}
402
+ ])).preservedQueenBees).to.equal(3)
403
+ })
404
+
405
+ it('can calculate ghostly infusion count', () => {
406
+ expect(itemsStatistics(generateAccount([
407
+ {id: 77303, count: 1},
408
+ {id: 30687, count: 1},
409
+ {id: 71383, count: 1},
410
+ {id: 77316, count: 1},
411
+ {id: 77394, count: 1}
412
+ ])).ghostlyInfusions).to.equal(3)
413
+ })
414
+
415
+ it('can calculate bauble infusion count', () => {
416
+ expect(itemsStatistics(generateAccount([
417
+ {id: 78079, count: 1},
418
+ {id: 30687, count: 1},
419
+ {id: 71383, count: 1},
420
+ {id: 78028, count: 1},
421
+ {id: 78097, count: 1}
422
+ ])).baubleInfusions).to.equal(3)
423
+ })
424
+
425
+ it('can calculate luminescent refractor count', () => {
426
+ expect(itemsStatistics(generateAccount([
427
+ {id: 67375, count: 1},
428
+ {id: 30687, count: 1},
429
+ {id: 71383, count: 1},
430
+ {id: 67370, count: 1},
431
+ {id: 67372, count: 1}
432
+ ])).luminescentRefractors).to.equal(3)
433
+ })
434
+
435
+ it('can calculate broken spoon count', () => {
436
+ expect(itemsStatistics(generateAccount([
437
+ {id: 74996, count: 1},
438
+ {id: 30687, count: 1},
439
+ {id: 71383, count: 1},
440
+ {id: 74996, count: 1},
441
+ {id: 74996, count: 1}
442
+ ])).brokenSpoons).to.equal(3)
443
+ })
444
+
445
+ it('can calculate black lion claim ticket count', () => {
446
+ expect(itemsStatistics(generateAccount([
447
+ {id: 43992, count: 1},
448
+ {id: 30687, count: 1},
449
+ {id: 71383, count: 1},
450
+ {id: 43998, count: 3},
451
+ {id: 43998, count: 1}
452
+ ])).blackLionClaimTickets).to.equal(1.4)
453
+
454
+ expect(itemsStatistics(generateAccount([
455
+ {id: 43992, count: 3},
456
+ {id: 30687, count: 1},
457
+ {id: 43998, count: 164}
458
+ ])).blackLionClaimTickets).to.equal(19.4)
459
+ })
460
+
461
+ it('can calculate instrument count', () => {
462
+ expect(itemsStatistics(generateAccount([
463
+ {id: 66323, count: 1},
464
+ {id: 30687, count: 1},
465
+ {id: 71383, count: 1},
466
+ {id: 38129, count: 1}, // This is a container and does not count
467
+ {id: 43526, count: 1}
468
+ ])).instruments).to.equal(2)
469
+ })
470
+
471
+ it('can calculate fish items count', () => {
472
+ const _statistics = itemsStatistics(generateAccount([
473
+ {id: 66323, count: 1},
474
+ {id: 97654, count: 2},
475
+ {id: 82432, count: 1},
476
+ {id: 97409, count: 1},
477
+ {id: 83826, count: 1}
478
+ ]))
479
+
480
+ expect(_statistics.fishItems).to.equal(3)
481
+ expect(_statistics.fishItemsLegendary).to.equal(2)
482
+ expect(_statistics.fishItemsAscended).to.equal(1)
483
+ expect(_statistics.fishItemsExotic).to.equal(0)
484
+ })
485
+
486
+ it('can calculate music box count', () => {
487
+ expect(itemsStatistics(generateAccount([
488
+ {id: 66323, count: 1},
489
+ {id: 30687, count: 1},
490
+ {id: 82432, count: 1},
491
+ {id: 38129, count: 1},
492
+ {id: 83826, count: 1}
493
+ ])).musicBoxes).to.equal(2)
494
+ })
495
+
496
+ it('can calculate permanent tool count', () => {
497
+ expect(itemsStatistics(generateAccount([
498
+ {id: 78806, count: 1},
499
+ {id: 30687, count: 1},
500
+ {id: 71383, count: 1},
501
+ {id: 38129, count: 1},
502
+ {id: 47897, count: 1}
503
+ ])).permanentTools).to.equal(2)
504
+ })
505
+
506
+ it('can calculate chak egg count', () => {
507
+ expect(itemsStatistics(generateAccount([
508
+ {id: 72205, count: 1},
509
+ {id: 30687, count: 1},
510
+ {id: 71383, count: 1},
511
+ {id: 72205, count: 1},
512
+ {id: 72205, count: 1}
513
+ ])).chakEggs).to.equal(3)
514
+ })
515
+
516
+ it('can calculate reclaimed metal plate count', () => {
517
+ expect(itemsStatistics(generateAccount([
518
+ {id: 74356, count: 1},
519
+ {id: 30687, count: 1},
520
+ {id: 71383, count: 1},
521
+ {id: 74356, count: 1},
522
+ {id: 74356, count: 1}
523
+ ])).reclaimedMetalPlates).to.equal(3)
524
+ })
525
+
526
+ it('can calculate fossilized insects count', () => {
527
+ expect(itemsStatistics(generateAccount([
528
+ {id: 66655, count: 1},
529
+ {id: 30687, count: 1},
530
+ {id: 71383, count: 1},
531
+ {id: 66646, count: 1},
532
+ {id: 66642, count: 1}
533
+ ])).fossilizedInsects).to.equal(3)
534
+ })
535
+
536
+ it('can calculate champion bag count', () => {
537
+ expect(itemsStatistics(generateAccount([
538
+ {id: 44216, count: 1},
539
+ {id: 30687, count: 1},
540
+ {id: 71383, count: 1},
541
+ {id: 44226, count: 1},
542
+ {id: 44199, count: 250}
543
+ ])).championBags).to.equal(252)
544
+ })
545
+
546
+ it('can calculate triple trouble chest count', () => {
547
+ expect(itemsStatistics(generateAccount([
548
+ {id: 49664, count: 1},
549
+ {id: 30687, count: 1},
550
+ {id: 71383, count: 1},
551
+ {id: 49664, count: 1},
552
+ {id: 49664, count: 250}
553
+ ])).tripleTroubleChests).to.equal(252)
554
+ })
555
+
556
+ it('can calculate tequatl chest count', () => {
557
+ expect(itemsStatistics(generateAccount([
558
+ {id: 47836, count: 1},
559
+ {id: 30687, count: 1},
560
+ {id: 71383, count: 1},
561
+ {id: 47836, count: 1},
562
+ {id: 47836, count: 250}
563
+ ])).tequatlChests).to.equal(252)
564
+ })
565
+
566
+ it('can calculate unique tonic count', () => {
567
+ expect(itemsStatistics(generateAccount([
568
+ {id: 68046, count: 3},
569
+ {id: 2, count: 1},
570
+ {id: 66768, count: 1},
571
+ {id: 66926, count: 1},
572
+ {id: 5, count: 250},
573
+ {id: 68046, count: 100}
574
+ ])).uniqueTonics).to.equal(2)
575
+ })
576
+
577
+ it('can calculate blood ruby count', () => {
578
+ expect(itemsStatistics(generateAccount([
579
+ {id: 79280, count: 1},
580
+ {id: 30687, count: 1},
581
+ {id: 71383, count: 1},
582
+ {id: 79280, count: 1},
583
+ {id: 79280, count: 250}
584
+ ])).bloodRubies).to.equal(252)
585
+ })
586
+
587
+ it('can calculate petrified wood count', () => {
588
+ expect(itemsStatistics(generateAccount([
589
+ {id: 79469, count: 1},
590
+ {id: 30687, count: 1},
591
+ {id: 71383, count: 1},
592
+ {id: 79469, count: 1},
593
+ {id: 79469, count: 250}
594
+ ])).petrifiedWood).to.equal(252)
595
+ })
596
+
597
+ it('can calculate tomes of knowledge count', () => {
598
+ expect(itemsStatistics(generateAccount([
599
+ {id: 43741, count: 1},
600
+ {id: 30687, count: 1},
601
+ {id: 71383, count: 1},
602
+ {id: 43741, count: 1},
603
+ {id: 43766, count: 250}
604
+ ])).tomesOfKnowledge).to.equal(252)
605
+ })
606
+
607
+ it('can calculate permanent contract count', () => {
608
+ expect(itemsStatistics(generateAccount([
609
+ {id: 35985, count: 1},
610
+ {id: 30687, count: 1},
611
+ {id: 71383, count: 1},
612
+ {id: 35984, count: 1},
613
+ {id: 49501, count: 1}
614
+ ])).permanentContracts).to.equal(3)
615
+ })
616
+
617
+ it('can calculate fresh winterberry count', () => {
618
+ expect(itemsStatistics(generateAccount([
619
+ {id: 79899, count: 2},
620
+ {id: 30687, count: 1},
621
+ {id: 79899, count: 1},
622
+ {id: 79899, count: 1},
623
+ {id: 49501, count: 1}
624
+ ])).freshWinterberries).to.equal(4)
625
+ })
626
+
627
+ it('can calculate winter\' heart infusion count', () => {
628
+ expect(itemsStatistics(generateAccount([
629
+ {id: 79899, count: 2},
630
+ {id: 79994, count: 1},
631
+ {id: 79959, count: 1},
632
+ {id: 79899, count: 1},
633
+ {id: 49501, count: 1}
634
+ ])).wintersHeartInfusions).to.equal(2)
635
+ })
636
+
637
+ it('can calculate kodas warmth enrichment count', () => {
638
+ expect(itemsStatistics(generateAccount([
639
+ {id: 79899, count: 2},
640
+ {id: 30687, count: 1},
641
+ {id: 79926, count: 1},
642
+ {id: 79899, count: 1},
643
+ {id: 49501, count: 1}
644
+ ])).kodasWarmthEnrichment).to.equal(1)
645
+ })
646
+
647
+ it('can calculate phospholuminescent infusions count', () => {
648
+ expect(itemsStatistics(generateAccount([
649
+ {id: 79899, count: 2},
650
+ {id: 30687, count: 1},
651
+ {id: 79653, count: 1},
652
+ {id: 79899, count: 1},
653
+ {id: 49501, count: 1}
654
+ ])).phospholuminescentInfusions).to.equal(1)
655
+ })
656
+
657
+ it('can calculate liquid aurillium count', () => {
658
+ expect(itemsStatistics(generateAccount([
659
+ {id: 76063, count: 2},
660
+ {id: 81715, count: 1},
661
+ {id: 79653, count: 1},
662
+ {id: 79899, count: 1},
663
+ {id: 49501, count: 1}
664
+ ])).liquidAurillium).to.equal(3)
665
+ })
666
+
667
+ it('can calculate celestial infusion count', () => {
668
+ expect(itemsStatistics(generateAccount([
669
+ {id: 81811, count: 2},
670
+ {id: 81927, count: 1},
671
+ {id: 79653, count: 1},
672
+ {id: 79899, count: 1},
673
+ {id: 49501, count: 1}
674
+ ])).celestialInfusion).to.equal(3)
675
+ })
676
+
677
+ it('can calculate gemstore toys count', () => {
678
+ expect(itemsStatistics(generateAccount([
679
+ {id: 79899, count: 2},
680
+ {id: 30687, count: 1},
681
+ {id: 49939, count: 1},
682
+ {id: 79899, count: 1},
683
+ {id: 49501, count: 1}
684
+ ])).gemstoreToys).to.equal(1)
685
+ })
686
+
687
+ it('can calculate black lion miniature claim tickets count', () => {
688
+ expect(itemsStatistics(generateAccount([
689
+ {id: 78474, count: 2},
690
+ {id: 30687, count: 1},
691
+ {id: 78474, count: 1},
692
+ {id: 79899, count: 1},
693
+ {id: 49501, count: 1}
694
+ ])).blackLionMiniatureClaimTickets).to.equal(3)
695
+ })
696
+
697
+ it('can calculate jade shards count', () => {
698
+ expect(itemsStatistics(generateAccount([
699
+ {id: 80332, count: 2},
700
+ {id: 78474, count: 2},
701
+ {id: 78474, count: 1},
702
+ {id: 80332, count: 1},
703
+ {id: 49501, count: 1}
704
+ ])).jadeShards).to.equal(3)
705
+ })
706
+
707
+ it('can calculate gifts of exploration count', () => {
708
+ expect(itemsStatistics(generateAccount([
709
+ {id: 19677, count: 2},
710
+ {id: 78474, count: 2},
711
+ {id: 78474, count: 1},
712
+ {id: 19677, count: 1},
713
+ {id: 49501, count: 1}
714
+ ])).giftsOfExploration).to.equal(3)
715
+ })
716
+
717
+ it('can calculate gifts of battle count', () => {
718
+ expect(itemsStatistics(generateAccount([
719
+ {id: 19678, count: 2},
720
+ {id: 78474, count: 2},
721
+ {id: 78474, count: 1},
722
+ {id: 19678, count: 1},
723
+ {id: 49501, count: 1}
724
+ ])).giftsOfBattle).to.equal(3)
725
+ })
726
+
727
+ it('can calculate dragonite ore count', () => {
728
+ expect(itemsStatistics(generateAccount([
729
+ {id: 78474, count: 1},
730
+ {id: 46733, count: 22},
731
+ {id: 78474, count: 1},
732
+ {id: 19677, count: 1},
733
+ {id: 46732, count: 4}
734
+ ])).dragoniteOre).to.equal(422)
735
+ })
736
+
737
+ it('can calculate bloodstone dust count', () => {
738
+ expect(itemsStatistics(generateAccount([
739
+ {id: 78474, count: 1},
740
+ {id: 46731, count: 22},
741
+ {id: 78474, count: 1},
742
+ {id: 19677, count: 1},
743
+ {id: 46730, count: 4}
744
+ ])).bloodstoneDust).to.equal(422)
745
+ })
746
+
747
+ it('can calculate empyreal fragments count', () => {
748
+ expect(itemsStatistics(generateAccount([
749
+ {id: 78474, count: 1},
750
+ {id: 46735, count: 22},
751
+ {id: 78474, count: 1},
752
+ {id: 19677, count: 1},
753
+ {id: 46734, count: 4}
754
+ ])).empyrealFragments).to.equal(422)
755
+ })
756
+
757
+ it('can calculate crystalline ore count', () => {
758
+ expect(itemsStatistics(generateAccount([
759
+ {id: 78474, count: 1},
760
+ {id: 46682, count: 22},
761
+ {id: 78474, count: 1},
762
+ {id: 19677, count: 1},
763
+ {id: 46683, count: 4}
764
+ ])).crystallineOre).to.equal(26)
765
+ })
766
+
767
+ it('can calculate airship oil count', () => {
768
+ expect(itemsStatistics(generateAccount([
769
+ {id: 78474, count: 1},
770
+ {id: 46682, count: 22},
771
+ {id: 78474, count: 1},
772
+ {id: 76933, count: 1},
773
+ {id: 69434, count: 4}
774
+ ])).airshipOil).to.equal(5)
775
+ })
776
+
777
+ it('can calculate auric dust count', () => {
778
+ expect(itemsStatistics(generateAccount([
779
+ {id: 78474, count: 1},
780
+ {id: 69432, count: 22},
781
+ {id: 73537, count: 1},
782
+ {id: 76933, count: 1},
783
+ {id: 69434, count: 4}
784
+ ])).auricDust).to.equal(53)
785
+ })
786
+
787
+ it('can calculate ley line sparks count', () => {
788
+ expect(itemsStatistics(generateAccount([
789
+ {id: 78474, count: 1},
790
+ {id: 69392, count: 22},
791
+ {id: 76933, count: 1},
792
+ {id: 74042, count: 1},
793
+ {id: 69434, count: 4}
794
+ ])).leyLineSparks).to.equal(24)
795
+ })
796
+
797
+ it('can calculate legendary spikes count', () => {
798
+ expect(itemsStatistics(generateAccount([
799
+ {id: 78474, count: 1},
800
+ {id: 81296, count: 22},
801
+ {id: 76933, count: 1},
802
+ {id: 74042, count: 1},
803
+ {id: 69434, count: 4}
804
+ ])).legendarySpikes).to.equal(22)
805
+ })
806
+
807
+ it('can calculate fire orchid blossoms count', () => {
808
+ expect(itemsStatistics(generateAccount([
809
+ {id: 78474, count: 1},
810
+ {id: 81296, count: 22},
811
+ {id: 81127, count: 1},
812
+ {id: 74042, count: 1},
813
+ {id: 81127, count: 4}
814
+ ])).fireOrchidBlossoms).to.equal(5)
815
+ })
816
+
817
+ it('can calculate orrian peal count', () => {
818
+ expect(itemsStatistics(generateAccount([
819
+ {id: 78474, count: 1},
820
+ {id: 81296, count: 22},
821
+ {id: 81706, count: 1},
822
+ {id: 74042, count: 1},
823
+ {id: 81706, count: 4}
824
+ ])).orrianPearls).to.equal(5)
825
+ })
826
+
827
+ it('can calculate luck', () => {
828
+ expect(itemsStatistics(generateAccount([
829
+ {id: 45175, count: 1}, // 10
830
+ {id: 45175, count: 5}, // 50
831
+ {id: 45176, count: 1}, // 50
832
+ {id: 45176, count: 8}, // 400
833
+ {id: 45177, count: 1}, // 100
834
+ {id: 45177, count: 4}, // 400
835
+ {id: 45178, count: 1}, // 200
836
+ {id: 45178, count: 3}, // 600
837
+ {id: 45179, count: 1}, // 500
838
+ {id: 45179, count: 7} // 3500
839
+ ]))._luckFromItems).to.equal(5810)
840
+ })
841
+
842
+ it('can calculate kralkatite ore', () => {
843
+ expect(itemsStatistics(generateAccount([
844
+ {id: 45175, count: 1},
845
+ {id: 45175, count: 5},
846
+ {id: 81743, count: 3},
847
+ {id: 45176, count: 8},
848
+ {id: 45177, count: 1},
849
+ {id: 86069, count: 4},
850
+ {id: 81743, count: 9},
851
+ {id: 45178, count: 3},
852
+ {id: 86069, count: 1},
853
+ {id: 45179, count: 7}
854
+ ])).kralkatiteOre).to.equal(5)
855
+ })
856
+
857
+ it('can calculate festive confetti infusions', () => {
858
+ expect(itemsStatistics(generateAccount([
859
+ {id: 45175, count: 1},
860
+ {id: 45175, count: 1},
861
+ {id: 84970, count: 1},
862
+ {id: 45176, count: 1},
863
+ {id: 45177, count: 1},
864
+ {id: 84871, count: 1},
865
+ {id: 81743, count: 1},
866
+ {id: 45178, count: 1},
867
+ {id: 84882, count: 1},
868
+ {id: 84882, count: 1}
869
+ ])).festiveConfettiInfusions).to.equal(4)
870
+ })
871
+
872
+ it('can calculate potions of pvp reward', () => {
873
+ expect(itemsStatistics(generateAccount([
874
+ {id: 45175, count: 1},
875
+ {id: 45175, count: 1},
876
+ {id: 68110, count: 1},
877
+ {id: 45176, count: 1},
878
+ {id: 45177, count: 1},
879
+ {id: 68110, count: 1},
880
+ {id: 81743, count: 1},
881
+ {id: 45178, count: 1},
882
+ {id: 84882, count: 1},
883
+ {id: 84882, count: 1}
884
+ ])).potionOfPvpRewards).to.equal(2)
885
+ })
886
+
887
+ it('can calculate potions of wvw reward', () => {
888
+ expect(itemsStatistics(generateAccount([
889
+ {id: 45175, count: 1},
890
+ {id: 45175, count: 1},
891
+ {id: 68110, count: 1},
892
+ {id: 78600, count: 1},
893
+ {id: 45177, count: 1},
894
+ {id: 68110, count: 1},
895
+ {id: 81743, count: 1},
896
+ {id: 78600, count: 1},
897
+ {id: 84882, count: 1},
898
+ {id: 84882, count: 1}
899
+ ])).potionOfWvwRewards).to.equal(2)
900
+ })
901
+
902
+ it('can calculate skirmish chests', () => {
903
+ expect(itemsStatistics(generateAccount([
904
+ {id: 45175, count: 1},
905
+ {id: 84966, count: 1},
906
+ {id: 68110, count: 1},
907
+ {id: 78600, count: 1},
908
+ {id: 45177, count: 1},
909
+ {id: 68110, count: 1},
910
+ {id: 81743, count: 1},
911
+ {id: 81324, count: 1},
912
+ {id: 84882, count: 1},
913
+ {id: 84882, count: 1}
914
+ ])).skirmishChests).to.equal(2)
915
+ })
916
+
917
+ it('can calculate unstable fractal essence', () => {
918
+ expect(itemsStatistics(generateAccount([
919
+ {id: 81743, count: 12}, // Unstable Cosmic Essence
920
+ {id: 94036, count: 1}, // Abyssal Fractal Weapon Box
921
+ {id: 94042, count: 1}, // Abyssal Fractal Axe Skin
922
+ {id: 94017, count: 1}, // Abyssal Infusion Chest
923
+ {id: 94024, count: 1}, // Abyssal Infusion
924
+ {id: 81790, count: 1}, // Celestial Infusion Chest
925
+ {id: 82070, count: 1}, // Celestial Infusion (Red)
926
+ {id: 81632, count: 1}, // Endless Chaos Combat Tonic
927
+ {id: 94055, count: 1}, // Endless Inner Demon Combat Tonic
928
+
929
+ {id: 81761, count: 9999999} // Celestial Infusion (Blue) -- (!) Does not count
930
+ ]))._unstableFractalEssenceFromItems).to.equal(7410)
931
+ })
932
+ })