Skip to content

Commit

Permalink
Skip yet to be updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
apache1123 committed Sep 15, 2024
1 parent b2fc076 commit 5e94f2b
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 82 deletions.
3 changes: 2 additions & 1 deletion src/models/v4/ability/__tests__/ability-event.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { TimeInterval } from '../../time-interval/time-interval';
import { AbilityEvent } from '../ability-event';

describe('Ability event', () => {
// TODO: out of date
describe.skip('Ability event', () => {
describe('cooldown', () => {
it('should not be on cooldown if there is no cooldown', () => {
const sut = new AbilityEvent(new TimeInterval(0, 10), 0);
Expand Down
3 changes: 2 additions & 1 deletion src/models/v4/ability/__tests__/ability-timeline.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { TimeInterval } from '../../time-interval/time-interval';
import { AbilityEvent } from '../ability-event';
import { AbilityTimeline } from '../ability-timeline';

describe('Ability timeline', () => {
// TODO: out of date
describe.skip('Ability timeline', () => {
describe('has event on cooldown', () => {
let sut: AbilityTimeline;

Expand Down
156 changes: 78 additions & 78 deletions src/models/v4/attack/__tests__/attack-ability.test.ts
Original file line number Diff line number Diff line change
@@ -1,86 +1,86 @@
// import { mock } from 'jest-mock-extended';
import { mock } from 'jest-mock-extended';

// import type { Weapon } from '../../../weapon';
// import type { Charge } from '../../charge/charge';
// import { TickTracker } from '../../tick/tick-tracker';
// import { TimeInterval } from '../../time-interval/time-interval';
// import { Timeline } from '../../timeline/timeline';
// import type { WeaponTracker } from '../../weapon-tracker/weapon-tracker';
// import { AttackAbility } from '../attack-ability';
// import type { AttackAbility } from '../../../../definitions/types/attack/attack-ability';
// import type { AttackEvent } from '../attack-event';
import type { Weapon } from '../../../weapon';
import type { Charge } from '../../charge/charge';
import { TickTracker } from '../../tick/tick-tracker';
import { TimeInterval } from '../../time-interval/time-interval';
import { Timeline } from '../../timeline/timeline';
import type { WeaponTracker } from '../../weapon-tracker/weapon-tracker';
import { AttackAbility } from '../attack-ability';
import type { AttackEvent } from '../attack-event';

// describe('Attack ability', () => {
// describe('adding attack event', () => {
// it('cuts the previous attack event short if a new one is added before it has ended', () => {
// const timeline = new Timeline<AttackEvent>(100);
// const definition = mock<AttackAbility>({
// endedBy: { duration: 20 },
// });
// const tickTracker = new TickTracker(new TimeInterval(0, 10), 10);
// TODO: out of date
describe.skip('Attack ability', () => {
describe('adding attack event', () => {
it('cuts the previous attack event short if a new one is added before it has ended', () => {
const timeline = new Timeline<AttackEvent>(100);
const definition = mock<AttackAbility>({
endedBy: { duration: 20 },
});
const tickTracker = new TickTracker(new TimeInterval(0, 10), 10);

// const sut = new AttackAbility(
// mock<Weapon>(),
// definition,
// timeline,
// tickTracker,
// mock<WeaponTracker>(),
// mock<Charge>()
// );
// sut.trigger();
// tickTracker.advanceTick();
// sut.trigger();
const sut = new AttackAbility(
mock<Weapon>(),
definition,
timeline,
tickTracker,
mock<WeaponTracker>(),
mock<Charge>()
);
sut.trigger();
tickTracker.advanceTick();
sut.trigger();

// expect(timeline.events[0].startTime).toBe(0);
// expect(timeline.events[0].endTime).toBe(10);
// expect(timeline.events[1].startTime).toBe(10);
// expect(timeline.events[1].endTime).toBe(30);
// });
// });
// describe('resolving elemental type', () => {
// it('returns the correct elemental type, when there are no special conditions', () => {
// const sut = newAttack({ defaultElementalType: 'Altered' });
// const event = sut.trigger();
// expect(event?.elementalType).toBe('Altered');
// });
expect(timeline.events[0].startTime).toBe(0);
expect(timeline.events[0].endTime).toBe(10);
expect(timeline.events[1].startTime).toBe(10);
expect(timeline.events[1].endTime).toBe(30);
});
});
describe('resolving elemental type', () => {
it('returns the correct elemental type, when there are no special conditions', () => {
const sut = newAttack({ defaultElementalType: 'Altered' });
const event = sut.trigger();
expect(event?.elementalType).toBe('Altered');
});

// it("returns the correct elemental type, when the attack's elemental type follows the active weapon", () => {
// const sut = newAttack({
// followCurrentWeaponElementalType: true,
// defaultElementalType: 'Flame',
// });
// const event = sut.trigger();
// expect(event?.elementalType).toBe('Altered');
// });
it("returns the correct elemental type, when the attack's elemental type follows the active weapon", () => {
const sut = newAttack({
followCurrentWeaponElementalType: true,
defaultElementalType: 'Flame',
});
const event = sut.trigger();
expect(event?.elementalType).toBe('Altered');
});

// it("returns the correct elemental type, when the attack's elemental type follows the previous weapon", () => {
// const sut = newAttack({
// followLastWeaponElementalType: true,
// defaultElementalType: 'Altered',
// });
// const event = sut.trigger();
// expect(event?.elementalType).toBe('Frost');
// });
it("returns the correct elemental type, when the attack's elemental type follows the previous weapon", () => {
const sut = newAttack({
followLastWeaponElementalType: true,
defaultElementalType: 'Altered',
});
const event = sut.trigger();
expect(event?.elementalType).toBe('Frost');
});

// function newAttack(elementalType: AttackAbility['elementalType']) {
// const timeline = new Timeline<AttackEvent>(100);
// const definition = mock<AttackAbility>({
// elementalType,
// triggeredBy: { playerInput: true },
// endedBy: { duration: 100 },
// });
function newAttack(elementalType: AttackAbility['elementalType']) {
const timeline = new Timeline<AttackEvent>(100);
const definition = mock<AttackAbility>({
elementalType,
triggeredBy: { playerInput: true },
endedBy: { duration: 100 },
});

// return new AttackAbility(
// mock<AttackAbility['weapon']>(),
// definition,
// timeline,
// mock<AttackAbility['tickTracker']>(),
// mock<AttackAbility['weaponTracker']>({
// activeWeapon: { damageElement: 'Altered' },
// previousWeapon: { damageElement: 'Frost' },
// }),
// mock<AttackAbility['charge']>()
// );
// }
// });
// });
return new AttackAbility(
mock<AttackAbility['weapon']>(),
definition,
timeline,
mock<AttackAbility['tickTracker']>(),
mock<AttackAbility['weaponTracker']>({
activeWeapon: { damageElement: 'Altered' },
previousWeapon: { damageElement: 'Frost' },
}),
mock<AttackAbility['charge']>()
);
}
});
});
3 changes: 2 additions & 1 deletion src/models/v4/attack/__tests__/attack-event.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { TimeInterval } from '../../time-interval/time-interval';
import { AttackEvent } from '../attack-event';

describe('Attack event', () => {
// TODO: out of date
describe.skip('Attack event', () => {
describe('time of hits', () => {
it('returns correct time of hits, when hit count is defined as fixed', () => {
const attackEvent = newAttackEvent({ numberOfHitsFixed: 5 });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import type { WeaponDefinition } from '../../../weapon-definition';
import { Damage } from '../../damage/damage';
import { DamageSummary } from '../damage-summary';

describe('DamageSummary', () => {
// TODO: out of date
describe.skip('DamageSummary', () => {
const duration = 1000;
const mockWeapon1 = new Weapon({ id: 'Alyss' } as WeaponDefinition);
const mockWeapon2 = new Weapon({ id: 'Annabella' } as WeaponDefinition);
Expand Down

0 comments on commit 5e94f2b

Please sign in to comment.