From b82123e1a2bcf75e49b4b36874d888faec201299 Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Sat, 3 Oct 2015 11:11:16 -0500 Subject: [PATCH] Update food tests --- test/content/food.js | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/test/content/food.js b/test/content/food.js index 868d781f79..27115a7c6c 100644 --- a/test/content/food.js +++ b/test/content/food.js @@ -1,20 +1,29 @@ import { - expectValidTranslationString + expectValidTranslationString, + describeEachItem } from '../helpers/content.helper'; - -import allFood from '../../common/script/src/content/food'; import {each} from 'lodash'; -describe('Food Locales', () => { - each(allFood, (food, key) => { - describe(`${key} Food`, () => { - it('has a valid text attribute', () => { - expectValidTranslationString(food.text); - }); +import allFood from '../../common/script/src/content/food'; - it('has a valid notes attribute', () => { - expectValidTranslationString(food.notes); - }); - }); +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); + }); + + it('has a valid notes attribute', () => { + expectValidTranslationString(food.notes); }); });