message: Wrote a couple of tests
diff: @@ -10,14 +10,14 @@ function getMod(
  season: number,
  tag: string,
  energyType: DestinyEnergyType,
  - hash?: number
  + energyCost: number = 0
  ): ProcessMod {
  return {
  season,
  tag,
  - energy: { type: energyType, val: 0 },
  + energy: { type: energyType, val: energyCost },
  investmentStats: [],
  - hash: hash || 0,
  + hash: 0, // need to mock this unfortunately
  };
  }
  @@ -25,13 +25,13 @@ function getItem(
  season: number,
  energyType: DestinyEnergyType,
  compatibleModSeasons?: string[],
  - id?: string
  + energyCost: number = 0
  ): ProcessItemSubset {
  return {
  - energy: { type: energyType, val: 0 },
  + energy: { type: energyType, val: energyCost },
  season,
  compatibleModSeasons,
  - id: id || 'id',
  + id: 'id', // need to mock this unfortunately
  };
  }
  @@ -258,3 +258,56 @@ describe('Sorting works for mods and items', () => {
  expect(result).toEqual(true);
  });
  });
  +
  +/*
  + Ensuring the energy requirement part works
  +*/
  +describe('Energy requirements correctly filter a set', () => {
  + it('passes when items and mods add up to 10', () => {
  + const mods = [
  + getMod(11, 'arrivals', 2, 5),
  + getMod(11, 'arrivals', 1, 5),
  + getMod(11, 'arrivals', 3, 5),
  + ].sort(sortProcessModsOrProcessItems);
  +
  + const items = [
  + getItem(11, 1, ['arrivals', 'worthy'], 5),
  + getItem(11, 2, ['arrivals', 'worthy'], 5),
  + getItem(11, 3, ['arrivals', 'worthy'], 5),
  + ];
  +
  + const result = canTakeAllSeasonalMods(mods, items);
  + expect(result).toEqual(true);
  + });
  +
  + it('fails when one item and mod add up to more than 10', () => {
  + const mods = [
  + getMod(11, 'arrivals', 2, 5),
  + getMod(11, 'arrivals', 1, 5),
  + getMod(11, 'arrivals', 3, 5),
  + ].sort(sortProcessModsOrProcessItems);
  +
  + const items = [
  + getItem(11, 1, ['arrivals', 'worthy'], 5),
  + getItem(11, 2, ['arrivals', 'worthy'], 6),
  + getItem(11, 3, ['arrivals', 'worthy'], 5),
  + ];
  +
  + const result = canTakeAllSeasonalMods(mods, items);
  + expect(result).toEqual(false);
  + });
  +
  + it('passes when an any mod needs the first mods space', () => {
  + const mods = [getMod(11, 'arrivals', 2, 4), getMod(11, 'arrivals', 0, 5)].sort(
  + sortProcessModsOrProcessItems
  + );
  +
  + const items = [
  + getItem(11, 2, ['arrivals', 'worthy'], 5),
  + getItem(11, 2, ['arrivals', 'worthy'], 6),
  + ];
  +
  + const result = canTakeAllSeasonalMods(mods, items);
  + expect(result).toEqual(true);
  + });
  +});
  