mirror of
https://github.com/motajs/template.git
synced 2026-11-02 15:04:30 +08:00
test(06-15): cover deleteAura via correct-expectation skip and register #06-15-1
- add pplies a global aura after addAura and stops applying it after deleteAura (it.skip, D-05) - reuse in-file createContextFixture/createEnemy/FakeAura/FakeConverter, no new helpers - register finding #06-15-1 in 06-TEST-FINDINGS.md (same root cause as #06-01-4) - unskip-verified: addAura applies (atk 2 -> 5) but deleteAura + buildup stays 5, expected 2
This commit is contained in:
1 parent
c747cd53d5
commit
65251f5f42
2 files changed
+73
No files matched your search
@@ -621,6 +621,47 @@ describe('EnemyContext single aura ranges', () => {
|
||||
).toBe(5);
|
||||
});
|
||||
|
||||
// 疑似 bug:deleteAura 后再次全量构建应回到基础 atk,详见 06-TEST-FINDINGS.md #06-15-1,修复后取消 skip
|
||||
it.skip('applies a global aura after addAura and stops applying it after deleteAura', () => {
|
||||
const fixture = createContextFixture();
|
||||
fixture.context.bindHero(fixture.hero);
|
||||
fixture.context.registerAuraConverter(new FakeConverter([]));
|
||||
fixture.context.setEnemyAt({ x: 0, y: 0 }, createEnemy('target'));
|
||||
const aura = new FakeAura({
|
||||
priority: 1,
|
||||
range: new modules.FullRange(),
|
||||
param: undefined,
|
||||
onApply: handler => handler.enemy.addAttribute('atk', 3)
|
||||
});
|
||||
|
||||
expect(
|
||||
fixture.context
|
||||
.getEnemyByLoc(0, 0)!
|
||||
.getComputedEnemy()
|
||||
.getAttribute('atk')
|
||||
).toBe(2);
|
||||
|
||||
fixture.context.addAura(aura);
|
||||
fixture.context.buildup();
|
||||
|
||||
expect(
|
||||
fixture.context
|
||||
.getEnemyByLoc(0, 0)!
|
||||
.getComputedEnemy()
|
||||
.getAttribute('atk')
|
||||
).toBe(5);
|
||||
|
||||
fixture.context.deleteAura(aura);
|
||||
fixture.context.buildup();
|
||||
|
||||
expect(
|
||||
fixture.context
|
||||
.getEnemyByLoc(0, 0)!
|
||||
.getComputedEnemy()
|
||||
.getAttribute('atk')
|
||||
).toBe(2);
|
||||
});
|
||||
|
||||
// 验证 Rect 范围的光环只加成矩形内怪物,范围外怪物属性不变
|
||||
it('applies a rect-range aura inside the rectangle only', () => {
|
||||
const fixture = createContextFixture();
|
||||
|
||||
Reference in new issue
Block a user