mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +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(allGearTypes, (klass) => {
|
||||||
each(gear[type][klass], (item, index) => {
|
each(gear[type][klass], (item, index) => {
|
||||||
let key = `${type}_${klass}_${index}`;
|
let key = `${type}_${klass}_${index}`;
|
||||||
|
let set = `${klass}-${index}`;
|
||||||
|
|
||||||
defaults(item, {
|
defaults(item, {
|
||||||
type,
|
type,
|
||||||
key,
|
key,
|
||||||
|
set,
|
||||||
klass,
|
klass,
|
||||||
index,
|
index,
|
||||||
str: 0,
|
str: 0,
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ describe('Gear', () => {
|
|||||||
each(piece, (items, klass) => {
|
each(piece, (items, klass) => {
|
||||||
context(`${klass} ${gearType}s`, () => {
|
context(`${klass} ${gearType}s`, () => {
|
||||||
it('have a value of at least 0 for each stat', () => {
|
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.con).to.be.at.least(0);
|
||||||
expect(gear.int).to.be.at.least(0);
|
expect(gear.int).to.be.at.least(0);
|
||||||
expect(gear.per).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', () => {
|
it('have a purchase value of at least 0', () => {
|
||||||
each(items, (gear, itemKey) => {
|
each(items, (gear) => {
|
||||||
expect(gear.value).to.be.at.least(0);
|
expect(gear.value).to.be.at.least(0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('has a canBuy function', () => {
|
it('has a canBuy function', () => {
|
||||||
each(items, (gear, itemKey) => {
|
each(items, (gear) => {
|
||||||
expect(gear.canBuy).to.be.a('function');
|
expect(gear.canBuy).to.be.a('function');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('have valid translation strings for text and notes', () => {
|
it('have valid translation strings for text and notes', () => {
|
||||||
each(items, (gear, itemKey) => {
|
each(items, (gear) => {
|
||||||
expectValidTranslationString(gear.text);
|
expectValidTranslationString(gear.text);
|
||||||
expectValidTranslationString(gear.notes);
|
expectValidTranslationString(gear.notes);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('has a set attribue', () => {
|
||||||
|
each(items, (gear) => {
|
||||||
|
expect(gear.set).to.exist;
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user