diff --git a/apps/web/src/app/features/inventory/inventory-detail-panel.component.spec.ts b/apps/web/src/app/features/inventory/inventory-detail-panel.component.spec.ts index bf0e3f3..451296e 100644 --- a/apps/web/src/app/features/inventory/inventory-detail-panel.component.spec.ts +++ b/apps/web/src/app/features/inventory/inventory-detail-panel.component.spec.ts @@ -37,6 +37,23 @@ const banditBlade: InventoryItem = { }, }; +const ashPelt: InventoryItem = { + id: 'item-pelt', + quantity: 3, + equipped: false, + item: { + key: 'ash-pelt', + name: 'Aschenfell', + rarity: 'COMMON', + equipmentSlot: null, + weaponDamage: 0, + bonusAttack: 0, + bonusHp: 0, + bonusArmor: 0, + iconPath: '/images/items/ash-pelt.png', + }, +}; + async function setup(overrides: { item?: InventoryItem | null; equippedItemInSlot?: InventoryItem | null; @@ -66,6 +83,15 @@ describe('InventoryDetailPanelComponent', () => { expect(element.querySelector('[data-detail-equip]')).toBeNull(); }); + it('refuses to offer an equip button for a non-equippable item', async () => { + const fixture = await setup({ item: ashPelt }); + const element = fixture.nativeElement as HTMLElement; + + expect(element.textContent).toContain('Nicht ausrüstbar'); + expect(element.querySelector('[data-detail-equip]')).toBeNull(); + expect(element.querySelector('[data-detail-equipped]')).toBeNull(); + }); + it('shows the stat comparison against the equipped item in the same slot', async () => { const fixture = await setup({ item: banditBlade, equippedItemInSlot: wornSword }); const text = (fixture.nativeElement as HTMLElement).querySelector('[data-detail-stats]')?.textContent ?? '';