mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
fix content tests
This commit is contained in:
@@ -62,7 +62,7 @@ describe('armoire', () => {
|
|||||||
expect(januaryItems2.length).to.equal(381);
|
expect(januaryItems2.length).to.equal(381);
|
||||||
clock.restore();
|
clock.restore();
|
||||||
delete require.cache[require.resolve('../../website/common/script/content/gear/sets/armoire')];
|
delete require.cache[require.resolve('../../website/common/script/content/gear/sets/armoire')];
|
||||||
clock = sinon.useFakeTimers(new Date('2024-02-07T09:00:00.000Z'));
|
clock = sinon.useFakeTimers(new Date('2024-02-07T16:00:00.000Z'));
|
||||||
const febuaryItems = makeArmoireIitemList();
|
const febuaryItems = makeArmoireIitemList();
|
||||||
expect(febuaryItems.length).to.equal(384);
|
expect(febuaryItems.length).to.equal(384);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {
|
|||||||
expectValidTranslationString,
|
expectValidTranslationString,
|
||||||
} from '../helpers/content.helper';
|
} from '../helpers/content.helper';
|
||||||
|
|
||||||
import { all, premium } from '../../website/common/script/content/hatching-potions';
|
import { all } from '../../website/common/script/content/hatching-potions';
|
||||||
|
|
||||||
describe('hatchingPotions', () => {
|
describe('hatchingPotions', () => {
|
||||||
let clock;
|
let clock;
|
||||||
@@ -35,20 +35,4 @@ describe('hatchingPotions', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('does not contain unreleased potions', () => {
|
|
||||||
clock = sinon.useFakeTimers(new Date('2024-05-20'));
|
|
||||||
const premiumPotions = premium;
|
|
||||||
expect(premiumPotions.Koi).to.not.exist;
|
|
||||||
});
|
|
||||||
|
|
||||||
it('Releases potions when appropriate without needing restarting', () => {
|
|
||||||
clock = sinon.useFakeTimers(new Date('2024-05-20'));
|
|
||||||
const mayPotions = premium;
|
|
||||||
clock.restore();
|
|
||||||
clock = sinon.useFakeTimers(new Date('2024-06-20'));
|
|
||||||
const junePotions = premium;
|
|
||||||
expect(junePotions.Koi).to.exist;
|
|
||||||
expect(Object.keys(mayPotions).length).to.equal(Object.keys(junePotions).length - 1);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user