forked from phenom/healer-man
Update Healer Man server
This commit is contained in:
1 parent
4fb7a0b9c8
commit
4c768fbec6
24 files changed
+654
-22
No files matched your search
@@ -39,6 +39,7 @@ import {
|
||||
} from "../game/manastormProgress";
|
||||
import { abilitiesForClass } from "../game/abilityCatalog";
|
||||
import { DUNGEON_RUN_CHECKPOINT_VERSION } from "../game/dungeonRunCheckpoint";
|
||||
import { WOW335_GLYPH_OF_SWIFTMEND_ID } from "../game/wow335GlyphCatalog";
|
||||
|
||||
class MemoryStorage implements StorageLike {
|
||||
private values = new Map<string, string>();
|
||||
@@ -48,6 +49,43 @@ class MemoryStorage implements StorageLike {
|
||||
}
|
||||
|
||||
describe("local profile repository", () => {
|
||||
it("defaults new glyph loadouts to empty and persists explicit glyph choices", () => {
|
||||
const storage = new MemoryStorage();
|
||||
const character = createCharacter({
|
||||
ownerId: "offline-roster",
|
||||
name: "Leafkeeper",
|
||||
categoryId: "wow",
|
||||
raceId: "night-elf",
|
||||
classId: "druid",
|
||||
specializationId: "druid:restoration",
|
||||
gender: "female",
|
||||
appearance: { skinColor: 0, face: 0, hairStyle: 0, hairColor: 0, feature: 0 },
|
||||
}, storage).character!;
|
||||
|
||||
expect(character.glyphIds).toEqual([]);
|
||||
|
||||
const legacyProfile = { ...character };
|
||||
delete (legacyProfile as Partial<typeof character>).glyphIds;
|
||||
const [migrated] = replaceCharactersForOwner("offline-roster", [legacyProfile], storage);
|
||||
expect(migrated?.glyphIds).toEqual([]);
|
||||
|
||||
const updated = updateCharacterProgression("offline-roster", migrated.id, {
|
||||
level: migrated.level,
|
||||
experience: migrated.experience,
|
||||
talentRanks: migrated.talentRanks,
|
||||
glyphIds: [WOW335_GLYPH_OF_SWIFTMEND_ID, WOW335_GLYPH_OF_SWIFTMEND_ID, " "],
|
||||
}, storage)!;
|
||||
expect(updated.glyphIds).toEqual([WOW335_GLYPH_OF_SWIFTMEND_ID]);
|
||||
expect(listCharacters("offline-roster", storage)[0]?.glyphIds).toEqual([WOW335_GLYPH_OF_SWIFTMEND_ID]);
|
||||
|
||||
const progressionOnly = updateCharacterProgression("offline-roster", migrated.id, {
|
||||
level: updated.level,
|
||||
experience: updated.experience,
|
||||
talentRanks: updated.talentRanks,
|
||||
}, storage)!;
|
||||
expect(progressionOnly.glyphIds).toEqual([WOW335_GLYPH_OF_SWIFTMEND_ID]);
|
||||
});
|
||||
|
||||
it("persists a safe dungeon checkpoint per character", () => {
|
||||
const storage = new MemoryStorage();
|
||||
const character = createCharacter({
|
||||
|
||||
Reference in new issue
Block a user