mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 06:07:21 +01:00
Improve testing around armor
This commit is contained in:
@@ -1,3 +1,3 @@
|
|||||||
describe('Gear Locales', () => {
|
describe('Gear', () => {
|
||||||
runTestsInDirectory('gear');
|
runTestsInDirectory('gear');
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,17 +1,40 @@
|
|||||||
import armor from '../../../common/script/src/content/gear/armor';
|
import {tree as allGear} from '../../../common/script/src/content/gear';
|
||||||
import {each} from 'lodash';
|
import {each} from 'lodash';
|
||||||
|
|
||||||
describe('Armor', () => {
|
describeEachItem('Armor', allGear.armor, (set, key) => {
|
||||||
each(armor, (set) => {
|
each(set, (gear, key) => {
|
||||||
each(set, (gear, key) => {
|
describe(`${key} Armor`, () => {
|
||||||
describe(`${key} Armor`, () => {
|
|
||||||
it('has a valid text attribute', () => {
|
|
||||||
expectValidTranslationString(gear.text);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('has a valid notes attribute', () => {
|
it('has a value attribute', () => {
|
||||||
expectValidTranslationString(gear.notes);
|
expect(gear.value).to.be.at.least(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('has a valid con attribute', () => {
|
||||||
|
expect(gear.con).to.be.at.least(0);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('has a valid int attribute', () => {
|
||||||
|
expect(gear.int).to.be.at.least(0);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('has a valid per attribute', () => {
|
||||||
|
expect(gear.per).to.be.at.least(0);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('has a valid str attribute', () => {
|
||||||
|
expect(gear.str).to.be.at.least(0);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('has a canBy function', () => {
|
||||||
|
expect(gear.canBuy).to.be.a('function');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('has a valid text attribute', () => {
|
||||||
|
expectValidTranslationString(gear.text);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('has a valid notes attribute', () => {
|
||||||
|
expectValidTranslationString(gear.notes);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user