mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
Pull out animal content into separate files (#7989)
* Pull out animal content into separate files * Correct variable names * Add tests for stable, eggs, and hatching potions content * Add content test back into npm test
This commit is contained in:
33
test/content/eggs.test.js
Normal file
33
test/content/eggs.test.js
Normal file
@@ -0,0 +1,33 @@
|
||||
import {
|
||||
each,
|
||||
} from 'lodash';
|
||||
import {
|
||||
expectValidTranslationString,
|
||||
} from '../helpers/content.helper';
|
||||
|
||||
import eggs from '../../common/script/content/eggs';
|
||||
|
||||
describe('eggs', () => {
|
||||
describe('all', () => {
|
||||
it('is a combination of drop and quest eggs', () => {
|
||||
let dropNumber = Object.keys(eggs.drops).length;
|
||||
let questNumber = Object.keys(eggs.quests).length;
|
||||
let allNumber = Object.keys(eggs.all).length;
|
||||
|
||||
expect(allNumber).to.be.greaterThan(0);
|
||||
expect(allNumber).to.equal(dropNumber + questNumber);
|
||||
});
|
||||
|
||||
it('contains basic information about each egg', () => {
|
||||
each(eggs.all, (egg, key) => {
|
||||
expectValidTranslationString(egg.text);
|
||||
expectValidTranslationString(egg.adjective);
|
||||
expectValidTranslationString(egg.mountText);
|
||||
expectValidTranslationString(egg.notes);
|
||||
expect(egg.canBuy).to.be.a('function');
|
||||
expect(egg.value).to.be.a('number');
|
||||
expect(egg.key).to.equal(key);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user