mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 14:17:22 +01:00
feat: Add set property to content
This commit is contained in:
@@ -39,10 +39,12 @@ each(GEAR_TYPES, (type) => {
|
||||
each(allGearTypes, (klass) => {
|
||||
each(gear[type][klass], (item, index) => {
|
||||
let key = `${type}_${klass}_${index}`;
|
||||
let set = `${klass}-${index}`;
|
||||
|
||||
defaults(item, {
|
||||
type,
|
||||
key,
|
||||
set,
|
||||
klass,
|
||||
index,
|
||||
str: 0,
|
||||
|
||||
@@ -13,7 +13,7 @@ describe('Gear', () => {
|
||||
each(piece, (items, klass) => {
|
||||
context(`${klass} ${gearType}s`, () => {
|
||||
it('have a value of at least 0 for each stat', () => {
|
||||
each(items, (gear, itemKey) => {
|
||||
each(items, (gear) => {
|
||||
expect(gear.con).to.be.at.least(0);
|
||||
expect(gear.int).to.be.at.least(0);
|
||||
expect(gear.per).to.be.at.least(0);
|
||||
@@ -22,23 +22,29 @@ describe('Gear', () => {
|
||||
});
|
||||
|
||||
it('have a purchase value of at least 0', () => {
|
||||
each(items, (gear, itemKey) => {
|
||||
each(items, (gear) => {
|
||||
expect(gear.value).to.be.at.least(0);
|
||||
});
|
||||
});
|
||||
|
||||
it('has a canBuy function', () => {
|
||||
each(items, (gear, itemKey) => {
|
||||
each(items, (gear) => {
|
||||
expect(gear.canBuy).to.be.a('function');
|
||||
});
|
||||
});
|
||||
|
||||
it('have valid translation strings for text and notes', () => {
|
||||
each(items, (gear, itemKey) => {
|
||||
each(items, (gear) => {
|
||||
expectValidTranslationString(gear.text);
|
||||
expectValidTranslationString(gear.notes);
|
||||
});
|
||||
});
|
||||
|
||||
it('has a set attribue', () => {
|
||||
each(items, (gear) => {
|
||||
expect(gear.set).to.exist;
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user