habitica/test/content/food.js

30 lines
692 B
JavaScript
Raw Normal View History

import {
2015-10-03 16:11:16 +00:00
expectValidTranslationString,
describeEachItem
} from '../helpers/content.helper';
2015-10-03 16:11:16 +00:00
import {each} from 'lodash';
2015-09-29 13:12:10 +00:00
import allFood from '../../common/script/src/content/food';
2015-10-03 16:11:16 +00:00
describeEachItem('Food', allFood, (food, key) => {
it('has a valid key', () => {
expect(food.key).to.eql(key);
});
it('has a valid value attribute', () => {
expect(food.value).to.be.greaterThan(0);
});
it('has a canBuy function', () => {
expect(food.canBuy).to.be.a('function');
});
it('has a valid text attribute', () => {
expectValidTranslationString(food.text);
});
2015-09-29 13:12:10 +00:00
2015-10-03 16:11:16 +00:00
it('has a valid notes attribute', () => {
expectValidTranslationString(food.notes);
2015-09-29 13:12:10 +00:00
});
});