update tests
This commit is contained in:
+207
-2
@@ -3,7 +3,7 @@ import { FrontworkAdmin } from "../src/backend/Admin/Admin";
|
||||
import { T1 } from "../src/backend/Types/Items";
|
||||
|
||||
import { RPCSocket } from "rpclibrary";
|
||||
import { FrontcraftIfc, Auth, User, FrontcraftFeatureIfc, Raid, Character, Rank, Class, Race } from "../src/backend/Types/Types";
|
||||
import { FrontcraftIfc, Auth, User, FrontcraftFeatureIfc, Raid, Character, Rank, Class, Race, SRPriority, Spec } from "../src/backend/Types/Types";
|
||||
import { SpecT } from "../src/backend/Types/PlayerSpecs";
|
||||
|
||||
|
||||
@@ -227,9 +227,214 @@ describe('Frontcraft', () => {
|
||||
})
|
||||
|
||||
it('calculate priorities', (done)=>{
|
||||
const makePrio = async (itemname:string, spec?: Spec, race?:Race, mod:number = 0, description:string = "") => {
|
||||
let specid
|
||||
if(spec)
|
||||
specid = await client.CharacterManager.getSpecId(spec.class, <any>spec.specname)
|
||||
|
||||
await adminClient.managePriorities.setPriority(itemname, {
|
||||
specid: specid,
|
||||
race: race,
|
||||
modifier: mod,
|
||||
description: description
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Promise.all([
|
||||
makePrio(
|
||||
'Bracers of Arcane Accuracy',
|
||||
{class:'Warlock', specname:'Demonology'},
|
||||
undefined, 2, "hit bias"
|
||||
),
|
||||
makePrio(
|
||||
'Bracers of Arcane Accuracy',
|
||||
{class:'Warlock', specname:'Affliction'},
|
||||
undefined, 2, "hit bias"
|
||||
),
|
||||
makePrio(
|
||||
'Bracers of Arcane Accuracy',
|
||||
{class:'Warlock', specname:'Destruction'},
|
||||
undefined, 2, "hit bias"
|
||||
),
|
||||
makePrio(
|
||||
'Bracers of Arcane Accuracy',
|
||||
{class:'Mage', specname:'Arcane'},
|
||||
undefined, 1, "hit bias"
|
||||
),
|
||||
makePrio(
|
||||
'Bracers of Arcane Accuracy',
|
||||
{class:'Mage', specname:'Frost'},
|
||||
undefined, 1, "hit bias"
|
||||
),
|
||||
makePrio(
|
||||
'Bracers of Arcane Accuracy',
|
||||
{class:'Mage', specname:'Fire'},
|
||||
undefined, 1, "hit bias"
|
||||
),
|
||||
|
||||
makePrio(
|
||||
'Maladath, Runed Blade of the Black Flight',
|
||||
{class:'Warrior', specname:'Fury'},
|
||||
'Human', 2, "weapon skill bias"
|
||||
),
|
||||
|
||||
makePrio(
|
||||
'Cloak of Firemaw',
|
||||
{class:'Rogue', specname:'Assassination'},
|
||||
undefined, 2, "agi-to-ap bias"
|
||||
),
|
||||
makePrio(
|
||||
'Cloak of Firemaw',
|
||||
{class:'Rogue', specname:'Combat'},
|
||||
undefined, 2, "agi-to-ap bias"
|
||||
),
|
||||
makePrio(
|
||||
'Cloak of Firemaw',
|
||||
{class:'Rogue', specname:'Subtlety'},
|
||||
undefined, 2, "agi-to-ap bias"
|
||||
),
|
||||
|
||||
makePrio(
|
||||
'Band of Forced Concentration',
|
||||
{class:'Warlock', specname:'Demonology'},
|
||||
undefined, 2, "hit bias"
|
||||
),
|
||||
makePrio(
|
||||
'Band of Forced Concentration',
|
||||
{class:'Warlock', specname:'Affliction'},
|
||||
undefined, 2, "hit bias"
|
||||
),
|
||||
makePrio(
|
||||
'Band of Forced Concentration',
|
||||
{class:'Warlock', specname:'Destruction'},
|
||||
undefined, 2, "hit bias"
|
||||
),
|
||||
makePrio(
|
||||
'Band of Forced Concentration',
|
||||
{class:'Mage', specname:'Arcane'},
|
||||
undefined, 1, "hit bias"
|
||||
),
|
||||
makePrio(
|
||||
'Band of Forced Concentration',
|
||||
{class:'Mage', specname:'Frost'},
|
||||
undefined, 1, "hit bias"
|
||||
),
|
||||
makePrio(
|
||||
'Band of Forced Concentration',
|
||||
{class:'Mage', specname:'Fire'},
|
||||
undefined, 1, "hit bias"
|
||||
),
|
||||
|
||||
makePrio(
|
||||
'Drake Fang Talisman',
|
||||
{class:'Rogue', specname:'Assassination'},
|
||||
undefined, 4, "hit bias"
|
||||
),
|
||||
makePrio(
|
||||
'Drake Fang Talisman',
|
||||
{class:'Rogue', specname:'Combat'},
|
||||
undefined, 4, "hit bias"
|
||||
),
|
||||
makePrio(
|
||||
'Drake Fang Talisman',
|
||||
{class:'Rogue', specname:'Subtlety'},
|
||||
undefined, 4, "hit bias"
|
||||
),
|
||||
makePrio(
|
||||
'Drake Fang Talisman',
|
||||
{class:'Warrior', specname:'Fury'},
|
||||
undefined, 2, "hit bias"
|
||||
),
|
||||
makePrio(
|
||||
'Drake Fang Talisman',
|
||||
{class:'Druid', specname:'Feral (DPS)'},
|
||||
undefined, 2, "hit bias"
|
||||
),
|
||||
|
||||
makePrio(
|
||||
'Circle of Applied Force',
|
||||
{class:'Warrior', specname:'Fury'},
|
||||
undefined, 2, "str-to-ap bias"
|
||||
),
|
||||
makePrio(
|
||||
'Circle of Applied Force',
|
||||
{class:'Druid', specname:'Feral (DPS)'},
|
||||
undefined, 2, "str-to-ap bias"
|
||||
),
|
||||
|
||||
makePrio(
|
||||
'Empowered Leggings',
|
||||
{class:'Paladin', specname:'Holy'},
|
||||
undefined, 2, "crit bias"
|
||||
),
|
||||
|
||||
makePrio(
|
||||
'Boots of the Shadow Flame',
|
||||
{class:'Rogue', specname:'Assassination'},
|
||||
undefined, 2, "hit bias"
|
||||
),
|
||||
makePrio(
|
||||
'Boots of the Shadow Flame',
|
||||
{class:'Rogue', specname:'Combat'},
|
||||
undefined, 2, "hit bias"
|
||||
),
|
||||
makePrio(
|
||||
'Boots of the Shadow Flame',
|
||||
{class:'Rogue', specname:'Subtlety'},
|
||||
undefined, 2, "hit bias"
|
||||
),
|
||||
makePrio(
|
||||
'Boots of the Shadow Flame',
|
||||
{class:'Druid', specname:'Feral (DPS)'},
|
||||
undefined, 2, "hit bias"
|
||||
),
|
||||
|
||||
makePrio(
|
||||
'Neltharion\'s Tear',
|
||||
{class:'Warlock', specname:'Demonology'},
|
||||
undefined, 4, "hit bias"
|
||||
),
|
||||
makePrio(
|
||||
'Neltharion\'s Tear',
|
||||
{class:'Warlock', specname:'Affliction'},
|
||||
undefined, 4, "hit bias"
|
||||
),
|
||||
makePrio(
|
||||
'Neltharion\'s Tear',
|
||||
{class:'Warlock', specname:'Destruction'},
|
||||
undefined, 4, "hit bias"
|
||||
),
|
||||
makePrio(
|
||||
'Neltharion\'s Tear',
|
||||
{class:'Mage', specname:'Arcane'},
|
||||
undefined, 2, "hit bias"
|
||||
),
|
||||
makePrio(
|
||||
'Neltharion\'s Tear',
|
||||
{class:'Mage', specname:'Frost'},
|
||||
undefined, 2, "hit bias"
|
||||
),
|
||||
makePrio(
|
||||
'Neltharion\'s Tear',
|
||||
{class:'Mage', specname:'Fire'},
|
||||
undefined, 2, "hit bias"
|
||||
),
|
||||
|
||||
makePrio(
|
||||
'Cloak of Draconic Might',
|
||||
{class:'Warrior', specname:'Fury'},
|
||||
undefined, 2, "str-to-ap bias"
|
||||
),
|
||||
makePrio(
|
||||
'Cloak of Draconic Might',
|
||||
{class:'Druid', specname:'Feral (DPS)'},
|
||||
undefined, 2, "str-to-ap bias"
|
||||
),
|
||||
])
|
||||
|
||||
|
||||
const user = Object.values(users)[0]
|
||||
|
||||
adminClient.managePriorities.setPriority(T1[0], {
|
||||
race: user.character.race,
|
||||
specid: user.character.specid,
|
||||
|
||||
Reference in New Issue
Block a user