fix test
This commit is contained in:
parent
8e648864df
commit
f7e269e72e
|
@ -1,7 +1,7 @@
|
||||||
const app = require(`${servicesDir}/item/server/server`);
|
const app = require(`${servicesDir}/item/server/server`);
|
||||||
|
|
||||||
describe('item getLastEntries()', () => {
|
describe('item getLastEntries()', () => {
|
||||||
it('should return one entry for a given item', async() => {
|
it('should return one entry for a given item', async () => {
|
||||||
let date = new Date();
|
let date = new Date();
|
||||||
let filter = {where: {itemFk: 1, date: date}};
|
let filter = {where: {itemFk: 1, date: date}};
|
||||||
let result = await app.models.Item.getLastEntries(filter);
|
let result = await app.models.Item.getLastEntries(filter);
|
||||||
|
@ -9,16 +9,7 @@ describe('item getLastEntries()', () => {
|
||||||
expect(result.length).toEqual(1);
|
expect(result.length).toEqual(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return two entries for a given item', async() => {
|
it('should return three entries for a given item', async () => {
|
||||||
let date = new Date();
|
|
||||||
date.setMonth(date.getMonth() - 1);
|
|
||||||
let filter = {where: {itemFk: 1, date: date}};
|
|
||||||
let result = await app.models.Item.getLastEntries(filter);
|
|
||||||
|
|
||||||
expect(result.length).toEqual(2);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should return three entries for a given item', async() => {
|
|
||||||
let date = new Date();
|
let date = new Date();
|
||||||
date.setMonth(date.getMonth() - 2);
|
date.setMonth(date.getMonth() - 2);
|
||||||
let filter = {where: {itemFk: 1, date: date}};
|
let filter = {where: {itemFk: 1, date: date}};
|
||||||
|
|
Loading…
Reference in New Issue