23 lines
1.0 KiB
TypeScript
23 lines
1.0 KiB
TypeScript
import { describe, it, expect } from 'vitest'
|
|
import { resolveMonsterArtSpec, MONSTER_ART_MAP } from '../src/game/monster-mapping.ts'
|
|
|
|
describe('monster-mapping', () => {
|
|
it('resolves standard Act 1 monsters', () => {
|
|
expect(resolveMonsterArtSpec('fallen1')).toEqual({ token: 'FA', weapon: 'hth' })
|
|
expect(resolveMonsterArtSpec('zombie1')).toEqual({ token: 'ZM', weapon: 'hth' })
|
|
expect(resolveMonsterArtSpec('quillrat1')).toEqual({ token: 'SI', weapon: 'hth' })
|
|
expect(resolveMonsterArtSpec('corruptrogue1')).toEqual({ token: 'CR', weapon: '1hs' })
|
|
expect(resolveMonsterArtSpec('cr_archer1')).toEqual({ token: 'CR', weapon: 'bow' })
|
|
})
|
|
|
|
it('resolves numbered variants through prefix fallback', () => {
|
|
expect(resolveMonsterArtSpec('fallen3')?.token).toBe('FA')
|
|
expect(resolveMonsterArtSpec('zombie5')?.token).toBe('ZM')
|
|
expect(resolveMonsterArtSpec('quillrat6')?.token).toBe('SI')
|
|
})
|
|
|
|
it('returns null for unknown monsters', () => {
|
|
expect(resolveMonsterArtSpec('non_existent_monster_xyz')).toBeNull()
|
|
})
|
|
})
|