Tarea #528 /item/getSummary.js Backend unit tests

This commit is contained in:
gerard 2018-08-22 09:09:16 +02:00
parent 1dd4ffcc13
commit 5a4f6e2e1e
1 changed files with 7 additions and 6 deletions

View File

@ -3,12 +3,13 @@ const app = require(`${servicesDir}/item/server/server`);
describe('item getSummary()', () => { describe('item getSummary()', () => {
it('should return summary with item, tags, botanical, niches, available and visible defined ', async() => { it('should return summary with item, tags, botanical, niches, available and visible defined ', async() => {
let result = await app.models.Item.getSummary(1); let result = await app.models.Item.getSummary(1);
let keys = Object.keys(result);
expect(result.item).toBeDefined(); expect(keys).toContain('item');
expect(result.tags).toBeDefined(); expect(keys).toContain('tags');
expect(result.botanical).toBeDefined(); expect(keys).toContain('botanical');
expect(result.niches).toBeDefined(); expect(keys).toContain('niches');
expect(result.available).toBeDefined(); expect(keys).toContain('available');
expect(result.visible).toBeDefined(); expect(keys).toContain('visible');
}); });
}); });