mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 22:27:26 +01:00
fix test lint
This commit is contained in:
@@ -11,15 +11,15 @@ describe('GET /shops/backgrounds', () => {
|
||||
});
|
||||
|
||||
it('returns a valid shop object', async () => {
|
||||
let shop = await user.get('/shops/backgrounds');
|
||||
const shop = await user.get('/shops/backgrounds');
|
||||
expect(shop.identifier).to.equal('backgroundShop');
|
||||
expect(shop.text).to.eql(t('backgroundShop'));
|
||||
expect(shop.notes).to.eql(t('backgroundShopText'));
|
||||
expect(shop.imageName).to.equal('background_shop');
|
||||
expect(shop.sets).to.be.an('array');
|
||||
|
||||
let sets = shop.sets.map(set => set.identifier);
|
||||
const sets = shop.sets.map(set => set.identifier);
|
||||
expect(sets).to.include('incentiveBackgrounds');
|
||||
expect(sets).to.include('backgrounds062014');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -11,7 +11,7 @@ describe('GET /shops/market', () => {
|
||||
});
|
||||
|
||||
it('returns a valid shop object', async () => {
|
||||
let shop = await user.get('/shops/market');
|
||||
const shop = await user.get('/shops/market');
|
||||
|
||||
expect(shop.identifier).to.equal('market');
|
||||
expect(shop.text).to.eql(t('market'));
|
||||
@@ -19,7 +19,7 @@ describe('GET /shops/market', () => {
|
||||
expect(shop.imageName).to.be.a('string');
|
||||
expect(shop.categories).to.be.an('array');
|
||||
|
||||
let categories = shop.categories.map(cat => cat.identifier);
|
||||
const categories = shop.categories.map(cat => cat.identifier);
|
||||
|
||||
expect(categories).to.include('eggs');
|
||||
expect(categories).to.include('hatchingPotions');
|
||||
@@ -32,22 +32,22 @@ describe('GET /shops/market', () => {
|
||||
'stats.gp': 99999999,
|
||||
});
|
||||
|
||||
let shop = await user.get('/shops/market');
|
||||
let items = shop.categories.reduce((array, category) => {
|
||||
category.items.forEach((item) => {
|
||||
const shop = await user.get('/shops/market');
|
||||
const items = shop.categories.reduce((array, category) => {
|
||||
category.items.forEach(item => {
|
||||
array.push(item);
|
||||
});
|
||||
|
||||
return array;
|
||||
}, []);
|
||||
|
||||
let results = await Promise.all(items.map((item) => {
|
||||
let { purchaseType, key } = item;
|
||||
const results = await Promise.all(items.map(item => {
|
||||
const { purchaseType, key } = item;
|
||||
return user.post(`/user/purchase/${purchaseType}/${key}`);
|
||||
}));
|
||||
|
||||
expect(results.length).to.be.greaterThan(0);
|
||||
items.forEach((item) => {
|
||||
items.forEach(item => {
|
||||
expect(item).to.include.keys('key', 'text', 'notes', 'class', 'value', 'currency');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -11,7 +11,7 @@ describe('GET /shops/quests', () => {
|
||||
});
|
||||
|
||||
it('returns a valid shop object', async () => {
|
||||
let shop = await user.get('/shops/quests');
|
||||
const shop = await user.get('/shops/quests');
|
||||
|
||||
expect(shop.identifier).to.equal('questShop');
|
||||
expect(shop.text).to.eql(t('quests'));
|
||||
@@ -19,7 +19,7 @@ describe('GET /shops/quests', () => {
|
||||
expect(shop.imageName).to.be.a('string');
|
||||
expect(shop.categories).to.be.an('array');
|
||||
|
||||
let categories = shop.categories.map(cat => cat.identifier);
|
||||
const categories = shop.categories.map(cat => cat.identifier);
|
||||
|
||||
expect(categories).to.include('unlockable');
|
||||
expect(categories).to.include('gold');
|
||||
|
||||
@@ -11,7 +11,7 @@ describe('GET /shops/seasonal', () => {
|
||||
});
|
||||
|
||||
it('returns a valid shop object', async () => {
|
||||
let shop = await user.get('/shops/seasonal');
|
||||
const shop = await user.get('/shops/seasonal');
|
||||
|
||||
expect(shop.identifier).to.equal('seasonalShop');
|
||||
expect(shop.text).to.eql(t('seasonalShop'));
|
||||
|
||||
@@ -11,7 +11,7 @@ describe('GET /shops/time-travelers', () => {
|
||||
});
|
||||
|
||||
it('returns a valid shop object', async () => {
|
||||
let shop = await user.get('/shops/time-travelers');
|
||||
const shop = await user.get('/shops/time-travelers');
|
||||
|
||||
expect(shop.identifier).to.equal('timeTravelersShop');
|
||||
expect(shop.text).to.eql(t('timeTravelers'));
|
||||
@@ -19,17 +19,17 @@ describe('GET /shops/time-travelers', () => {
|
||||
expect(shop.imageName).to.be.a('string');
|
||||
expect(shop.categories).to.be.an('array');
|
||||
|
||||
let categories = shop.categories.map(cat => cat.identifier);
|
||||
const categories = shop.categories.map(cat => cat.identifier);
|
||||
|
||||
expect(categories).to.include('pets');
|
||||
expect(categories).to.include('mounts');
|
||||
expect(categories).to.include('201606');
|
||||
|
||||
let mammothPet = shop.categories
|
||||
const mammothPet = shop.categories
|
||||
.find(cat => cat.identifier === 'pets')
|
||||
.items
|
||||
.find(pet => pet.key === 'Mammoth-Base');
|
||||
let mantisShrimp = shop.categories
|
||||
const mantisShrimp = shop.categories
|
||||
.find(cat => cat.identifier === 'mounts')
|
||||
.items
|
||||
.find(pet => pet.key === 'MantisShrimp-Base');
|
||||
@@ -43,14 +43,14 @@ describe('GET /shops/time-travelers', () => {
|
||||
'purchased.plan.consecutive.trinkets': 1,
|
||||
});
|
||||
|
||||
let shop = await user.get('/shops/time-travelers');
|
||||
const shop = await user.get('/shops/time-travelers');
|
||||
|
||||
expect(shop.notes).to.eql(t('timeTravelersPopover'));
|
||||
expect(shop.imageName).to.eql('npc_timetravelers_active');
|
||||
});
|
||||
|
||||
it('returns inactive shop notes and imageName if user has trinkets', async () => {
|
||||
let shop = await user.get('/shops/time-travelers');
|
||||
const shop = await user.get('/shops/time-travelers');
|
||||
|
||||
expect(shop.notes).to.eql(t('timeTravelersPopoverNoSubMobile'));
|
||||
expect(shop.imageName).to.eql('npc_timetravelers');
|
||||
@@ -64,9 +64,9 @@ describe('GET /shops/time-travelers', () => {
|
||||
},
|
||||
});
|
||||
|
||||
let shop = await user.get('/shops/time-travelers');
|
||||
const shop = await user.get('/shops/time-travelers');
|
||||
|
||||
let categories = shop.categories.map(cat => cat.identifier);
|
||||
const categories = shop.categories.map(cat => cat.identifier);
|
||||
|
||||
expect(categories).to.not.include('201606');
|
||||
});
|
||||
@@ -81,13 +81,13 @@ describe('GET /shops/time-travelers', () => {
|
||||
},
|
||||
});
|
||||
|
||||
let shop = await user.get('/shops/time-travelers');
|
||||
const shop = await user.get('/shops/time-travelers');
|
||||
|
||||
let mammothPet = shop.categories
|
||||
const mammothPet = shop.categories
|
||||
.find(cat => cat.identifier === 'pets')
|
||||
.items
|
||||
.find(pet => pet.key === 'Mammoth-Base');
|
||||
let mantisShrimp = shop.categories
|
||||
const mantisShrimp = shop.categories
|
||||
.find(cat => cat.identifier === 'mounts')
|
||||
.items
|
||||
.find(pet => pet.key === 'MantisShrimp-Base');
|
||||
|
||||
Reference in New Issue
Block a user