mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-14 13:17:24 +01:00
commit28193f86fbAuthor: Phillip Thelen <phillip@habitica.com> Date: Fri Jun 21 11:12:18 2024 +0200 Fix serving memoized content commit877fe48225Author: Phillip Thelen <phillip@habitica.com> Date: Thu Jun 20 12:23:24 2024 +0200 correctly memoize conent api commite0f6f79c5bAuthor: Phillip Thelen <phillip@habitica.com> Date: Thu Jun 20 10:11:27 2024 +0200 don’t build multiple times on heroku commitf62254d68eAuthor: Phillip Thelen <phillip@habitica.com> Date: Wed Jun 19 19:40:20 2024 +0200 fix client command commitd054e6fc16Author: Phillip Thelen <phillip@habitica.com> Date: Wed Jun 19 19:36:57 2024 +0200 correct build call commit7231f699c1Author: Phillip Thelen <phillip@habitica.com> Date: Wed Jun 19 19:32:32 2024 +0200 try setting up with heroku buildpack commit1dae0793fdAuthor: Phillip Thelen <phillip@habitica.com> Date: Wed Jun 19 18:50:32 2024 +0200 call gulp build:prod commitf18fbe86b6Author: Phillip Thelen <phillip@habitica.com> Date: Wed Jun 19 18:40:53 2024 +0200 build client commit61a61724caAuthor: Phillip Thelen <phillip@habitica.com> Date: Wed Jun 19 18:33:18 2024 +0200 testing commit93cf30eb18Author: Phillip Thelen <phillip@habitica.com> Date: Wed Jun 19 18:20:25 2024 +0200 integration fix commitcff08adcd0Author: Phillip Thelen <phillip@habitica.com> Date: Wed Jun 19 18:13:20 2024 +0200 specify dev docker file commit4da2ed4a1fAuthor: Phillip Thelen <phillip@habitica.com> Date: Wed Jun 19 18:10:07 2024 +0200 initialize stub commit11c5b26c59Author: Phillip Thelen <phillip@habitica.com> Date: Wed Jun 19 18:08:45 2024 +0200 test heroku file commitac85bb2e2dAuthor: Phillip Thelen <phillip@habitica.com> Date: Wed Jun 19 18:03:15 2024 +0200 fix stub reference commit74dfb2710fAuthor: Phillip Thelen <phillip@habitica.com> Date: Wed Jun 19 18:01:27 2024 +0200 test fixes commit8dbd3c3db1Author: Phillip Thelen <phillip@habitica.com> Date: Wed Jun 19 17:37:04 2024 +0200 fix canOwn test commit74b3b348ffAuthor: Phillip Thelen <phillip@habitica.com> Date: Wed Jun 19 17:32:31 2024 +0200 fix buy test commit3386d61fdeAuthor: Phillip Thelen <phillip@habitica.com> Date: Wed Jun 19 17:30:37 2024 +0200 fix debug tests commit19da14531cAuthor: Phillip Thelen <phillip@habitica.com> Date: Wed Jun 19 17:05:25 2024 +0200 add chameleon to featured quests commit254dd80f24Author: Phillip Thelen <phillip@habitica.com> Date: Wed Jun 19 17:05:14 2024 +0200 fix import commit0bc3f16b4bAuthor: Phillip Thelen <phillip@habitica.com> Date: Wed Jun 19 16:33:22 2024 +0200 add new content to new release file commit5184973bd5Author: Phillip Thelen <phillip@habitica.com> Date: Wed Jun 19 16:33:11 2024 +0200 fix release date tests commitb6accca5caAuthor: Phillip Thelen <phillip@habitica.com> Date: Wed Jun 19 16:33:06 2024 +0200 fix armoire tests commitfec68e6211Author: Phillip Thelen <phillip@habitica.com> Date: Wed Jun 19 16:02:03 2024 +0200 fix tests commitfc63c906ddAuthor: Phillip Thelen <phillip@habitica.com> Date: Mon Jun 10 14:44:21 2024 +0200 Improve test coverage commit3333f8f0f5Author: Phillip Thelen <phillip@habitica.com> Date: Mon Jun 10 14:24:59 2024 +0200 allow hatching potions to have a release date commit89a3ac3ddeAuthor: Phillip Thelen <phillip@habitica.com> Date: Mon Jun 10 14:11:38 2024 +0200 allow eggs to have a release date # Conflicts: # test/content/armoire.test.js commit16551ec83fMerge:f5f4974a732645bf6023Author: CuriousMagpie <eilatan@gmail.com> Date: Tue Jun 18 15:03:12 2024 -0400 Merge branch '2024-07-content-prebuild' into subs-private commit2645bf6023Author: CuriousMagpie <eilatan@gmail.com> Date: Tue Jun 18 15:02:47 2024 -0400 update habitica images commitf5f4974a73Author: CuriousMagpie <eilatan@gmail.com> Date: Tue Jun 18 14:58:13 2024 -0400 update habitica-images commit162e337d14Merge:f2506c323121a7d36b7bAuthor: CuriousMagpie <eilatan@gmail.com> Date: Tue Jun 18 13:46:03 2024 -0400 Merge branch '2024-07-content-prebuild' into subs-private commit21a7d36b7bAuthor: CuriousMagpie <eilatan@gmail.com> Date: Tue Jun 18 13:45:09 2024 -0400 update sprites commitf2506c3231Author: CuriousMagpie <eilatan@gmail.com> Date: Tue Jun 18 13:24:21 2024 -0400 updated sprites css commitd47641e25aAuthor: CuriousMagpie <eilatan@gmail.com> Date: Tue Jun 18 12:46:59 2024 -0400 typo fix commitfb8479ad1eAuthor: CuriousMagpie <eilatan@gmail.com> Date: Mon Jun 17 13:44:36 2024 -0400 finish July prebuild commit3810cf3ef3Author: CuriousMagpie <eilatan@gmail.com> Date: Fri Jun 14 10:42:47 2024 -0400 add chameleon quest commitd05da3722cAuthor: CuriousMagpie <eilatan@gmail.com> Date: Thu Jun 13 17:12:43 2024 -0400 add June background notes commitb8a3440ef2Author: CuriousMagpie <eilatan@gmail.com> Date: Thu Jun 13 16:40:04 2024 -0400 fix mystery item and background description commit44d63032d8Author: CuriousMagpie <eilatan@gmail.com> Date: Thu Jun 13 15:38:23 2024 -0400 add subscriber gear, enchanted armoire, and background commit9d7da91ec6Author: CuriousMagpie <eilatan@gmail.com> Date: Thu Jun 13 14:44:59 2024 -0400 add sprites
170 lines
6.2 KiB
JavaScript
170 lines
6.2 KiB
JavaScript
import {
|
|
each,
|
|
} from 'lodash';
|
|
import {
|
|
expectValidTranslationString,
|
|
} from '../helpers/content.helper';
|
|
import t from '../../website/common/script/content/translation';
|
|
|
|
import stable from '../../website/common/script/content/stable';
|
|
import eggs from '../../website/common/script/content/eggs';
|
|
import potions from '../../website/common/script/content/hatching-potions';
|
|
|
|
describe('stable', () => {
|
|
describe('dropPets', () => {
|
|
let clock;
|
|
beforeEach(() => {
|
|
clock = sinon.useFakeTimers(new Date('2020-05-20'));
|
|
});
|
|
|
|
afterEach(() => {
|
|
clock.restore();
|
|
});
|
|
|
|
it('contains a pet for each drop potion * each drop egg', () => {
|
|
const numberOfDropPotions = Object.keys(potions.drops).length;
|
|
const numberOfDropEggs = Object.keys(eggs.drops).length;
|
|
const numberOfDropPets = Object.keys(stable.dropPets).length;
|
|
const expectedTotal = numberOfDropPotions * numberOfDropEggs;
|
|
|
|
expect(numberOfDropPets).to.be.greaterThan(0);
|
|
expect(numberOfDropPets).to.equal(expectedTotal);
|
|
});
|
|
});
|
|
|
|
describe('questPets', () => {
|
|
it('contains a pet for each drop potion * each quest egg', () => {
|
|
const numberOfDropPotions = Object.keys(potions.drops).length;
|
|
const numberOfQuestEggs = Object.keys(eggs.quests).length;
|
|
const numberOfQuestPets = Object.keys(stable.questPets).length;
|
|
const expectedTotal = numberOfDropPotions * numberOfQuestEggs;
|
|
|
|
expect(numberOfQuestPets).to.be.greaterThan(0);
|
|
expect(numberOfQuestPets).to.equal(expectedTotal);
|
|
});
|
|
});
|
|
|
|
describe('premiumPets', () => {
|
|
it('contains a pet for each premium potion * each drop egg', () => {
|
|
const numberOfPremiumPotions = Object.keys(potions.premium).length;
|
|
const numberOfDropEggs = Object.keys(eggs.drops).length;
|
|
const numberOfPremiumPets = Object.keys(stable.premiumPets).length;
|
|
const expectedTotal = numberOfPremiumPotions * numberOfDropEggs;
|
|
|
|
expect(numberOfPremiumPets).to.be.greaterThan(0);
|
|
expect(numberOfPremiumPets).to.equal(expectedTotal);
|
|
});
|
|
});
|
|
|
|
describe('wackyPets', () => {
|
|
it('contains a pet for each wacky potion * each drop egg', () => {
|
|
const numberOfWackyPotions = Object.keys(potions.wacky).length;
|
|
const numberOfDropEggs = Object.keys(eggs.drops).length;
|
|
const numberOfWackyPets = Object.keys(stable.wackyPets).length;
|
|
const expectedTotal = numberOfWackyPotions * numberOfDropEggs;
|
|
|
|
expect(numberOfWackyPets).to.be.greaterThan(0);
|
|
expect(numberOfWackyPets).to.equal(expectedTotal);
|
|
});
|
|
});
|
|
|
|
describe('specialPets', () => {
|
|
it('each value is a valid translation string', () => {
|
|
each(stable.specialPets, pet => {
|
|
const string = t(pet);
|
|
expectValidTranslationString(string);
|
|
});
|
|
});
|
|
});
|
|
|
|
describe('dropMounts', () => {
|
|
it('contains a mount for each drop potion * each drop egg', () => {
|
|
const numberOfDropPotions = Object.keys(potions.drops).length;
|
|
const numberOfDropEggs = Object.keys(eggs.drops).length;
|
|
const numberOfDropMounts = Object.keys(stable.dropMounts).length;
|
|
const expectedTotal = numberOfDropPotions * numberOfDropEggs;
|
|
|
|
expect(numberOfDropMounts).to.be.greaterThan(0);
|
|
expect(numberOfDropMounts).to.equal(expectedTotal);
|
|
});
|
|
});
|
|
|
|
describe('questMounts', () => {
|
|
it('contains a mount for each drop potion * each quest egg', () => {
|
|
const numberOfDropPotions = Object.keys(potions.drops).length;
|
|
const numberOfQuestEggs = Object.keys(eggs.quests).length;
|
|
const numberOfQuestMounts = Object.keys(stable.questMounts).length;
|
|
const expectedTotal = numberOfDropPotions * numberOfQuestEggs;
|
|
|
|
expect(numberOfQuestMounts).to.be.greaterThan(0);
|
|
expect(numberOfQuestMounts).to.equal(expectedTotal);
|
|
});
|
|
});
|
|
|
|
describe('premiumMounts', () => {
|
|
it('contains a mount for each premium potion * each drop egg', () => {
|
|
const numberOfPremiumPotions = Object.keys(potions.premium).length;
|
|
const numberOfDropEggs = Object.keys(eggs.drops).length;
|
|
const numberOfPremiumMounts = Object.keys(stable.premiumMounts).length;
|
|
const expectedTotal = numberOfPremiumPotions * numberOfDropEggs;
|
|
|
|
expect(numberOfPremiumMounts).to.be.greaterThan(0);
|
|
expect(numberOfPremiumMounts).to.equal(expectedTotal);
|
|
});
|
|
});
|
|
|
|
describe('specialMounts', () => {
|
|
it('each value is a valid translation string', () => {
|
|
each(stable.specialMounts, mount => {
|
|
const string = t(mount);
|
|
expectValidTranslationString(string);
|
|
});
|
|
});
|
|
});
|
|
|
|
describe('petInfo', () => {
|
|
it('contains an entry for all pets', () => {
|
|
const dropNumber = Object.keys(stable.dropPets).length;
|
|
const questNumber = Object.keys(stable.questPets).length;
|
|
const specialNumber = Object.keys(stable.specialPets).length;
|
|
const premiumNumber = Object.keys(stable.premiumPets).length;
|
|
const wackyNumber = Object.keys(stable.wackyPets).length;
|
|
const allNumber = Object.keys(stable.petInfo).length;
|
|
|
|
expect(allNumber).to.be.greaterThan(0);
|
|
expect(allNumber).to.equal(
|
|
dropNumber + questNumber + specialNumber + premiumNumber + wackyNumber,
|
|
);
|
|
});
|
|
|
|
it('contains basic information about each pet', () => {
|
|
each(stable.petInfo, (pet, key) => {
|
|
expectValidTranslationString(pet.text);
|
|
expect(pet.type).to.be.a('string');
|
|
expect(pet.key).to.equal(key);
|
|
});
|
|
});
|
|
});
|
|
|
|
describe('mountInfo', () => {
|
|
it('contains an entry for all mounts', () => {
|
|
const dropNumber = Object.keys(stable.dropMounts).length;
|
|
const questNumber = Object.keys(stable.questMounts).length;
|
|
const specialNumber = Object.keys(stable.specialMounts).length;
|
|
const premiumNumber = Object.keys(stable.premiumMounts).length;
|
|
const allNumber = Object.keys(stable.mountInfo).length;
|
|
|
|
expect(allNumber).to.be.greaterThan(0);
|
|
expect(allNumber).to.equal(dropNumber + questNumber + specialNumber + premiumNumber);
|
|
});
|
|
|
|
it('contains basic information about each mount', () => {
|
|
each(stable.mountInfo, (mount, key) => {
|
|
expectValidTranslationString(mount.text);
|
|
expect(mount.type).to.be.a('string');
|
|
expect(mount.key).to.equal(key);
|
|
});
|
|
});
|
|
});
|
|
});
|