Files
habitica/test/api/v3/integration/shops/GET-shops_quests.test.js
Phillip Thelen 24d25026cf Add API calls for shop inventories (#7810)
* Add API call for market inventory

* changes to shop api calls

* optimize shop categories

* add API call for quests

* add api call for time travelers shop

* fic buying items in shops

* fix linting errors

* shop adjustments for iOS app

* add tests to shops

* fix syntax issues

* Code formatting

* correct indentation

* add tests for api routes

* fix time travelers and seasonal

* Increase test coverage for shop routes

* refactor: Pull out trinket count in time traveler route

* refactor: Clarify instructions for seasonal shop script

* lint: Remove extra new line

* Adjust shops common test
2016-07-26 14:36:55 -05:00

29 lines
759 B
JavaScript

import {
generateUser,
translate as t,
} from '../../../../helpers/api-integration/v3';
describe('GET /shops/quests', () => {
let user;
beforeEach(async () => {
user = await generateUser();
});
it('returns a valid shop object', async () => {
let shop = await user.get('/shops/quests');
expect(shop.identifier).to.equal('questShop');
expect(shop.text).to.eql(t('quests'));
expect(shop.notes).to.eql(t('ianTextMobile'));
expect(shop.imageName).to.be.a('string');
expect(shop.categories).to.be.an('array');
let categories = shop.categories.map(cat => cat.identifier);
expect(categories).to.include('unlockable');
expect(categories).to.include('gold');
expect(categories).to.include('pet');
});
});