Browse Source

update tests

master
peter 5 years ago
parent
commit
b987974b9e
34 changed files with 339 additions and 26 deletions
  1. 4
    4
      src/backend/Components/Item/ItemManager.ts
  2. 72
    1
      src/backend/Types/Items.ts
  3. 2
    2
      src/backend/Types/PlayerSpecs.ts
  4. 3
    1
      src/frontend/src/app/@theme/components/header/header.component.ts
  5. 16
    10
      src/frontend/src/app/frontcraft/pages/raid/characterpicker.component.html
  6. 1
    1
      src/frontend/src/app/frontcraft/pages/raids/createraid.component.html
  7. 25
    5
      src/frontend/src/app/frontcraft/pages/raids/raids.component.html
  8. 9
    0
      src/frontend/src/app/frontcraft/pages/raids/raids.component.scss
  9. BIN
      src/frontend/src/assets/images/alan.png
  10. BIN
      src/frontend/src/assets/images/camera1.jpg
  11. BIN
      src/frontend/src/assets/images/camera2.jpg
  12. BIN
      src/frontend/src/assets/images/camera3.jpg
  13. BIN
      src/frontend/src/assets/images/camera4.jpg
  14. BIN
      src/frontend/src/assets/images/cover1.jpg
  15. BIN
      src/frontend/src/assets/images/cover2.jpg
  16. BIN
      src/frontend/src/assets/images/cover3.jpg
  17. BIN
      src/frontend/src/assets/images/druid.png
  18. BIN
      src/frontend/src/assets/images/eva.png
  19. BIN
      src/frontend/src/assets/images/hunter.png
  20. BIN
      src/frontend/src/assets/images/jack.png
  21. BIN
      src/frontend/src/assets/images/kate.png
  22. BIN
      src/frontend/src/assets/images/kitten-corporate.png
  23. BIN
      src/frontend/src/assets/images/kitten-cosmic.png
  24. BIN
      src/frontend/src/assets/images/kitten-dark.png
  25. BIN
      src/frontend/src/assets/images/kitten-default.png
  26. BIN
      src/frontend/src/assets/images/lee.png
  27. BIN
      src/frontend/src/assets/images/mage.png
  28. BIN
      src/frontend/src/assets/images/nick.png
  29. BIN
      src/frontend/src/assets/images/paladin.png
  30. BIN
      src/frontend/src/assets/images/priest.png
  31. BIN
      src/frontend/src/assets/images/rogue.png
  32. BIN
      src/frontend/src/assets/images/shaman.png
  33. BIN
      src/frontend/src/assets/images/warrior.png
  34. 207
    2
      test/backendTest.ts

+ 4
- 4
src/backend/Components/Item/ItemManager.ts View File

@@ -1,4 +1,4 @@
1
-import { T1 } from "../../Types/Items";
1
+import { T1, T2 } from "../../Types/Items";
2 2
 import { Inject, Injectable } from "../../Injector/ServiceDecorator";
3 3
 import { ItemManagerFeatureIfc, ItemManagerIfc } from "./RPCInterface";
4 4
 import { FrontworkComponent } from "../../Types/FrontworkComponent";
@@ -9,7 +9,6 @@ import { IItemManager } from "./Interface";
9 9
 import { getLogger } from "log4js";
10 10
 import { IUserManager } from "../User/Interface";
11 11
 import { ICharacterManager } from "../Character/Interface";
12
-import { join } from "path";
13 12
 
14 13
 const fetch = require('node-fetch')
15 14
 const xml2js = require('xml2js');
@@ -250,10 +249,11 @@ implements FrontworkComponent<ItemManagerIfc, ItemManagerFeatureIfc>, TableDefin
250 249
         if(this.initialized) return
251 250
         this.initialized = true        
252 251
         
253
-        const allItems = [...T1]
254
-        getLogger('ItemManager').debug('Checking items')
252
+        const allItems = [...T1, ...T2]
255 253
 
256 254
         const countCache = await this.countItems()
255
+        getLogger('ItemManager').debug('Checking items, got: ',countCache, 'expected: ', allItems.length)
256
+
257 257
         if(countCache != allItems.length){
258 258
             const items:Item[] = await Promise.all(allItems.map((i) => this.fetchItem(i)))
259 259
             try{

+ 72
- 1
src/backend/Types/Items.ts View File

@@ -61,4 +61,75 @@ export const T1 = [
61 61
 "Ring of Binding",
62 62
 "Shard of the Scale",
63 63
 "Head of Onyxia",
64
-"Bindings of the Windseeker"]
64
+"Bindings of the Windseeker"]
65
+
66
+export const T2:string[] = [
67
+"Gloves of Rapid Evolution",
68
+"Mantle of the Blackwing Cabal",
69
+"Spineshatter",
70
+"The Untamed Blade",
71
+"Pendant of the Fallen Dragon",
72
+"Helm of Endless Rage",
73
+"Dragonfang Blade",
74
+"Red Dragonscale Protector",
75
+"Black Brood Pauldrons",
76
+"Bracers of Arcane Accuracy",
77
+"Heartstriker",
78
+"Maladath, Runed Blade of the Black Flight",
79
+"Black Ash Robe",
80
+"Firemaw's Clutch",
81
+"Claw of the Black Drake",
82
+"Cloak of Firemaw",
83
+"Legguards of the Fallen Crusader",
84
+"Taut Dragonhide Belt",
85
+"Drake Talon Pauldrons",
86
+"Rejuvenating Gem",
87
+"Drake Talon Cleaver",
88
+"Band of Forced Concentration",
89
+"Drake Fang Talisman",
90
+"Ebony Flame Gloves",
91
+"Malfurion's Blessed Bulwark",
92
+"Dragonbreath Hand Cannon",
93
+"Shadow Wing Focus Staff",
94
+"Shroud of Pure Thought",
95
+"Circle of Applied Force",
96
+"Emberweave Leggings",
97
+"Styleen's Impeding Scarab",
98
+"Dragon's Touch",
99
+"Herald of Woe",
100
+"Taut Dragonhide Shoulderpads",
101
+"Chromatic Boots",
102
+"Taut Dragonhide Gloves",
103
+"Shimmering Geta",
104
+"Elementium Threaded Cloak",
105
+"Angelista's Grasp",
106
+"Girdle of the Fallen Crusader",
107
+"Empowered Leggings",
108
+"Chromatically Tempered Sword",
109
+"Claw of Chromaggus",
110
+"Primalist's Linked Waistguard",
111
+"Ashjre'thul, Crossbow of Smiting",
112
+"Elementium Reinforced Bulwark",
113
+"Head of Nefarian",
114
+"Cloak of the Brood Lord",
115
+"Boots of the Shadow Flame",
116
+"Therazane's Link",
117
+"Archimtiros' Ring of Reckoning",
118
+"Neltharion's Tear",
119
+"Pure Elementium Band",
120
+"Mish'undare, Circlet of the Mind Flayer",
121
+"Prestor's Talisman of Connivery",
122
+"Staff of the Shadow Flame",
123
+"Ashkandi, Greatsword of the Brotherhood",
124
+"Crul'shorukh, Edge of Chaos",
125
+"Lok'amir il Romathis",
126
+"Boots of Pure Thought",
127
+"Cloak of Draconic Might",
128
+"Draconic Maul",
129
+"Doom's Edge",
130
+"Essence Gatherer",
131
+"Band of Dark Dominion",
132
+"Draconic Avenger",
133
+"Interlaced Shadow Jerkin",
134
+"Ringo's Blizzard Boots"
135
+]

+ 2
- 2
src/backend/Types/PlayerSpecs.ts View File

@@ -2,7 +2,7 @@ import { Spec, _Class, Class } from "./Types"
2 2
 
3 3
 export type SpecT = {
4 4
     Warrior : 'Arms' | 'Fury' | 'Protection'
5
-    Rogue: 'Subetly' | 'Combat' | 'Assassination'
5
+    Rogue: 'Subtlety' | 'Combat' | 'Assassination'
6 6
     Hunter: 'Beast Mastery' | 'Marksmanship' | 'Survival'
7 7
     Paladin: 'Holy' | 'Protection' | 'Retribution'
8 8
     Priest: 'Discipline' | 'Holy' | 'Shadow'
@@ -20,7 +20,7 @@ export const specs : { [classname in keyof SpecT] : SpecT[classname][] } = {
20 20
     ],
21 21
 
22 22
     Rogue: [
23
-        'Subetly',
23
+        'Subtlety',
24 24
         'Combat',
25 25
         'Assassination'
26 26
     ],

+ 3
- 1
src/frontend/src/app/@theme/components/header/header.component.ts View File

@@ -40,7 +40,7 @@ export class HeaderComponent implements OnInit, OnDestroy {
40 40
     },
41 41
   ];
42 42
 
43
-  currentTheme = 'dark';
43
+  currentTheme = 'default';
44 44
   userMenu : NbMenuItem[] = [ { title: 'Log out', link: '/auth/logout' } ];
45 45
 
46 46
   sendMessage: any = console.log
@@ -59,6 +59,8 @@ export class HeaderComponent implements OnInit, OnDestroy {
59 59
              ) {}
60 60
 
61 61
   ngOnInit() {
62
+    this.themeService.changeTheme("dark");
63
+
62 64
     this.currentTheme = this.themeService.currentTheme;
63 65
 
64 66
     this.user = this.api.getCurrentUser()

+ 16
- 10
src/frontend/src/app/frontcraft/pages/raid/characterpicker.component.html View File

@@ -1,30 +1,36 @@
1
-<nb-card class="col-12 col-xl-9">
1
+<nb-card style="width: 500px; padding: 0px 2rem 2rem 2rem">
2 2
     <nb-card-header>
3 3
       Pick Character
4 4
     </nb-card-header>
5 5
     <nb-card-body>
6 6
         <div *ngFor="let character of characters">
7
+            <img [src]="'../../../../assets/images/'+character.class.toLowerCase()+'.png'" />
8
+            <span [ngStyle]="{'color': character.color}">
9
+                {{character.charactername}}
10
+            </span>
11
+            <br >
12
+            <br >
13
+            <br >
14
+
7 15
             <button
8 16
                 (click)="signup(character, false)"
9 17
                 nbButton 
10 18
                 outline 
11 19
                 status="success" 
12
-                size="tiny">
13
-                <nb-icon icon="checkmark-outline"></nb-icon>
20
+                size="medium">
21
+                <nb-icon icon="checkmark-outline"></nb-icon> On Time
14 22
             </button>
15
-
23
+            &nbsp;
24
+            &nbsp;
25
+            &nbsp;
16 26
             <button
17 27
                 (click)="signup(character, true)"
18 28
                 nbButton 
19 29
                 outline 
20 30
                 status="warning" 
21
-                size="tiny">
22
-                <nb-icon icon="clock-outline"></nb-icon>
31
+                size="medium">
32
+                <nb-icon icon="clock-outline"></nb-icon> Late
23 33
             </button>
24
-            <span [ngStyle]="{'color': character.color}">
25
-                {{character.charactername}}
26
-            </span>
27
-                
28 34
         </div>
29 35
     </nb-card-body>
30 36
 </nb-card>

+ 1
- 1
src/frontend/src/app/frontcraft/pages/raids/createraid.component.html View File

@@ -1,6 +1,6 @@
1 1
 
2 2
 
3
-<nb-card class="col-12 col-xl-9">
3
+<nb-card style="width: 500px; padding: 0px 2rem 2rem 2rem">
4 4
     <nb-card-header>
5 5
       Create Raid
6 6
     </nb-card-header>

+ 25
- 5
src/frontend/src/app/frontcraft/pages/raids/raids.component.html View File

@@ -11,11 +11,31 @@
11 11
     nbInfiniteList
12 12
     listenWindowScroll
13 13
     [threshold]="500">
14
-    <nb-list-item *ngFor="let raid of raids" [routerLink]="'/frontcraft/raid/'+raid.id">
15
-      <b>{{raid.title}}</b><br>
16
-      {{raid.signupcount}} / {{raid.size}}<br>
17
-      {{raid.start | date : 'EEEE d MMMM @ HH:mm'}}<br>
18
-      {{raid.description}}<br>
14
+    <nb-list-item *ngFor="let raid of raids" 
15
+    [routerLink]="'/frontcraft/raid/'+raid.id" 
16
+    class="raidlist"
17
+    style="cursor: pointer;">
18
+      <div class="row">
19
+        <div class="col-2">
20
+          <img src="../../../../assets/images/mage.png" style="height: 75px" />
21
+        </div>
22
+
23
+        <div class="col-2 vcenter">
24
+          {{raid.title}}
25
+         </div>
26
+        
27
+        <div class="col-2 vcenter">
28
+          <nb-icon icon="checkmark-circle"></nb-icon> {{raid.signupcount}} / {{raid.size}}<br>
29
+        </div>
30
+
31
+        <div class="col-2 vcenter">
32
+          <nb-icon icon="clock-outline"></nb-icon> {{raid.start | date : 'HH:mm'}}
33
+        </div>
34
+
35
+        <div class="col-4 vcenter">
36
+          <nb-icon icon="calendar-outline"></nb-icon> {{raid.start | date : 'EEEE MMMM d'}}
37
+        </div>
38
+      </div>
19 39
     </nb-list-item>
20 40
   </nb-list>
21 41
 </nb-card>

+ 9
- 0
src/frontend/src/app/frontcraft/pages/raids/raids.component.scss View File

@@ -5,3 +5,12 @@
5 5
     }
6 6
   }
7 7
 }
8
+
9
+.raidlist:hover {
10
+  background-color: #293259;
11
+}
12
+
13
+.vcenter {
14
+  height: 75px;
15
+  padding-top: 30px;
16
+}

BIN
src/frontend/src/assets/images/alan.png View File


BIN
src/frontend/src/assets/images/camera1.jpg View File


BIN
src/frontend/src/assets/images/camera2.jpg View File


BIN
src/frontend/src/assets/images/camera3.jpg View File


BIN
src/frontend/src/assets/images/camera4.jpg View File


BIN
src/frontend/src/assets/images/cover1.jpg View File


BIN
src/frontend/src/assets/images/cover2.jpg View File


BIN
src/frontend/src/assets/images/cover3.jpg View File


BIN
src/frontend/src/assets/images/druid.png View File


BIN
src/frontend/src/assets/images/eva.png View File


BIN
src/frontend/src/assets/images/hunter.png View File


BIN
src/frontend/src/assets/images/jack.png View File


BIN
src/frontend/src/assets/images/kate.png View File


BIN
src/frontend/src/assets/images/kitten-corporate.png View File


BIN
src/frontend/src/assets/images/kitten-cosmic.png View File


BIN
src/frontend/src/assets/images/kitten-dark.png View File


BIN
src/frontend/src/assets/images/kitten-default.png View File


BIN
src/frontend/src/assets/images/lee.png View File


BIN
src/frontend/src/assets/images/mage.png View File


BIN
src/frontend/src/assets/images/nick.png View File


BIN
src/frontend/src/assets/images/paladin.png View File


BIN
src/frontend/src/assets/images/priest.png View File


BIN
src/frontend/src/assets/images/rogue.png View File


BIN
src/frontend/src/assets/images/shaman.png View File


BIN
src/frontend/src/assets/images/warrior.png View File


+ 207
- 2
test/backendTest.ts View File

@@ -3,7 +3,7 @@ import { FrontworkAdmin } from "../src/backend/Admin/Admin";
3 3
 import { T1 } from "../src/backend/Types/Items";
4 4
 
5 5
 import { RPCSocket } from "rpclibrary";
6
-import { FrontcraftIfc, Auth, User, FrontcraftFeatureIfc, Raid, Character, Rank, Class, Race } from "../src/backend/Types/Types";
6
+import { FrontcraftIfc, Auth, User, FrontcraftFeatureIfc, Raid, Character, Rank, Class, Race, SRPriority, Spec } from "../src/backend/Types/Types";
7 7
 import { SpecT } from "../src/backend/Types/PlayerSpecs";
8 8
 
9 9
 
@@ -227,9 +227,214 @@ describe('Frontcraft', () => {
227 227
     })
228 228
 
229 229
     it('calculate priorities', (done)=>{
230
+        const makePrio = async (itemname:string, spec?: Spec, race?:Race, mod:number = 0, description:string = "") => {
231
+            let specid
232
+            if(spec)
233
+                specid = await client.CharacterManager.getSpecId(spec.class, <any>spec.specname)
234
+            
235
+            await adminClient.managePriorities.setPriority(itemname, {
236
+                specid: specid,
237
+                race: race,
238
+                modifier: mod,
239
+                description: description
240
+            })
241
+        }
242
+
243
+              
244
+        Promise.all([
245
+            makePrio(
246
+                'Bracers of Arcane Accuracy', 
247
+                {class:'Warlock', specname:'Demonology'}, 
248
+                undefined, 2, "hit bias"
249
+            ),
250
+            makePrio(
251
+                'Bracers of Arcane Accuracy', 
252
+                {class:'Warlock', specname:'Affliction'}, 
253
+                undefined, 2, "hit bias"
254
+            ),
255
+            makePrio(
256
+                'Bracers of Arcane Accuracy', 
257
+                {class:'Warlock', specname:'Destruction'}, 
258
+                undefined, 2, "hit bias"
259
+            ),
260
+            makePrio(
261
+                'Bracers of Arcane Accuracy', 
262
+                {class:'Mage', specname:'Arcane'}, 
263
+                undefined, 1, "hit bias"
264
+            ),
265
+            makePrio(
266
+                'Bracers of Arcane Accuracy', 
267
+                {class:'Mage', specname:'Frost'}, 
268
+                undefined, 1, "hit bias"
269
+            ),
270
+            makePrio(
271
+                'Bracers of Arcane Accuracy', 
272
+                {class:'Mage', specname:'Fire'}, 
273
+                undefined, 1, "hit bias"
274
+            ),
275
+
276
+            makePrio(
277
+                'Maladath, Runed Blade of the Black Flight', 
278
+                {class:'Warrior', specname:'Fury'}, 
279
+                'Human', 2, "weapon skill bias"
280
+            ),
281
+
282
+            makePrio(
283
+                'Cloak of Firemaw', 
284
+                {class:'Rogue', specname:'Assassination'}, 
285
+                undefined, 2, "agi-to-ap bias"
286
+            ),
287
+            makePrio(
288
+                'Cloak of Firemaw', 
289
+                {class:'Rogue', specname:'Combat'}, 
290
+                undefined, 2, "agi-to-ap bias"
291
+            ),
292
+            makePrio(
293
+                'Cloak of Firemaw', 
294
+                {class:'Rogue', specname:'Subtlety'}, 
295
+                undefined, 2, "agi-to-ap bias"
296
+            ),
297
+
298
+            makePrio(
299
+                'Band of Forced Concentration', 
300
+                {class:'Warlock', specname:'Demonology'}, 
301
+                undefined, 2, "hit bias"
302
+            ),
303
+            makePrio(
304
+                'Band of Forced Concentration', 
305
+                {class:'Warlock', specname:'Affliction'}, 
306
+                undefined, 2, "hit bias"
307
+            ),
308
+            makePrio(
309
+                'Band of Forced Concentration', 
310
+                {class:'Warlock', specname:'Destruction'}, 
311
+                undefined, 2, "hit bias"
312
+            ),
313
+            makePrio(
314
+                'Band of Forced Concentration', 
315
+                {class:'Mage', specname:'Arcane'}, 
316
+                undefined, 1, "hit bias"
317
+            ),
318
+            makePrio(
319
+                'Band of Forced Concentration', 
320
+                {class:'Mage', specname:'Frost'}, 
321
+                undefined, 1, "hit bias"
322
+            ),
323
+            makePrio(
324
+                'Band of Forced Concentration', 
325
+                {class:'Mage', specname:'Fire'}, 
326
+                undefined, 1, "hit bias"
327
+            ),
328
+
329
+            makePrio(
330
+                'Drake Fang Talisman', 
331
+                {class:'Rogue', specname:'Assassination'}, 
332
+                undefined, 4, "hit bias"
333
+            ),
334
+            makePrio(
335
+                'Drake Fang Talisman', 
336
+                {class:'Rogue', specname:'Combat'}, 
337
+                undefined, 4, "hit bias"
338
+            ),
339
+            makePrio(
340
+                'Drake Fang Talisman', 
341
+                {class:'Rogue', specname:'Subtlety'}, 
342
+                undefined, 4, "hit bias"
343
+            ),
344
+            makePrio(
345
+                'Drake Fang Talisman', 
346
+                {class:'Warrior', specname:'Fury'}, 
347
+                undefined, 2, "hit bias"
348
+            ),
349
+            makePrio(
350
+                'Drake Fang Talisman', 
351
+                {class:'Druid', specname:'Feral (DPS)'}, 
352
+                undefined, 2, "hit bias"
353
+            ),
354
+
355
+            makePrio(
356
+                'Circle of Applied Force', 
357
+                {class:'Warrior', specname:'Fury'}, 
358
+                undefined, 2, "str-to-ap bias"
359
+            ),
360
+            makePrio(
361
+                'Circle of Applied Force', 
362
+                {class:'Druid', specname:'Feral (DPS)'}, 
363
+                undefined, 2, "str-to-ap bias"
364
+            ),
365
+
366
+            makePrio(
367
+                'Empowered Leggings', 
368
+                {class:'Paladin', specname:'Holy'}, 
369
+                undefined, 2, "crit bias"
370
+            ),
371
+
372
+            makePrio(
373
+                'Boots of the Shadow Flame', 
374
+                {class:'Rogue', specname:'Assassination'}, 
375
+                undefined, 2, "hit bias"
376
+            ),
377
+            makePrio(
378
+                'Boots of the Shadow Flame', 
379
+                {class:'Rogue', specname:'Combat'}, 
380
+                undefined, 2, "hit bias"
381
+            ),
382
+            makePrio(
383
+                'Boots of the Shadow Flame', 
384
+                {class:'Rogue', specname:'Subtlety'}, 
385
+                undefined, 2, "hit bias"
386
+            ),
387
+            makePrio(
388
+                'Boots of the Shadow Flame', 
389
+                {class:'Druid', specname:'Feral (DPS)'}, 
390
+                undefined, 2, "hit bias"
391
+            ),
392
+
393
+            makePrio(
394
+                'Neltharion\'s Tear', 
395
+                {class:'Warlock', specname:'Demonology'}, 
396
+                undefined, 4, "hit bias"
397
+            ),
398
+            makePrio(
399
+                'Neltharion\'s Tear', 
400
+                {class:'Warlock', specname:'Affliction'}, 
401
+                undefined, 4, "hit bias"
402
+            ),
403
+            makePrio(
404
+                'Neltharion\'s Tear', 
405
+                {class:'Warlock', specname:'Destruction'}, 
406
+                undefined, 4, "hit bias"
407
+            ),
408
+            makePrio(
409
+                'Neltharion\'s Tear', 
410
+                {class:'Mage', specname:'Arcane'}, 
411
+                undefined, 2, "hit bias"
412
+            ),
413
+            makePrio(
414
+                'Neltharion\'s Tear', 
415
+                {class:'Mage', specname:'Frost'}, 
416
+                undefined, 2, "hit bias"
417
+            ),
418
+            makePrio(
419
+                'Neltharion\'s Tear', 
420
+                {class:'Mage', specname:'Fire'}, 
421
+                undefined, 2, "hit bias"
422
+            ),
423
+
424
+            makePrio(
425
+                'Cloak of Draconic Might', 
426
+                {class:'Warrior', specname:'Fury'}, 
427
+                undefined, 2, "str-to-ap bias"
428
+            ),
429
+            makePrio(
430
+                'Cloak of Draconic Might', 
431
+                {class:'Druid', specname:'Feral (DPS)'}, 
432
+                undefined, 2, "str-to-ap bias"
433
+            ),
434
+        ])
230 435
 
231
-        const user = Object.values(users)[0]
232 436
 
437
+        const user = Object.values(users)[0]
233 438
         adminClient.managePriorities.setPriority(T1[0], {
234 439
             race: user.character.race,
235 440
             specid: user.character.specid,

Loading…
Cancel
Save