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()', () => {
it('should return summary with item, tags, botanical, niches, available and visible defined ', async() => {
let result = await app.models.Item.getSummary(1);
let keys = Object.keys(result);
expect(result.item).toBeDefined();
expect(result.tags).toBeDefined();
expect(result.botanical).toBeDefined();
expect(result.niches).toBeDefined();
expect(result.available).toBeDefined();
expect(result.visible).toBeDefined();
expect(keys).toContain('item');
expect(keys).toContain('tags');
expect(keys).toContain('botanical');
expect(keys).toContain('niches');
expect(keys).toContain('available');
expect(keys).toContain('visible');
});
});