fix: refs #7404 test for lasEntriesFilter
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Pablo Natek 2024-10-03 12:08:23 +02:00
parent 616c328681
commit 3f325d865f
1 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
const {models} = require('vn-loopback/server/server'); const {models} = require('vn-loopback/server/server');
describe('item lastEntriesFilter()', () => { describe('item lastEntriesFilter()', () => {
it('should return one entry for the given item', async() => { it('should return two entry for the given item', async() => {
const minDate = Date.vnNew(); const minDate = Date.vnNew();
minDate.setHours(0, 0, 0, 0); minDate.setHours(0, 0, 0, 0);
const maxDate = Date.vnNew(); const maxDate = Date.vnNew();
@ -13,7 +13,7 @@ describe('item lastEntriesFilter()', () => {
const filter = {where: {itemFk: 1, landed: {between: [minDate, maxDate]}}}; const filter = {where: {itemFk: 1, landed: {between: [minDate, maxDate]}}};
const result = await models.Item.lastEntriesFilter(filter, options); const result = await models.Item.lastEntriesFilter(filter, options);
expect(result.length).toEqual(1); expect(result.length).toEqual(2);
await tx.rollback(); await tx.rollback();
} catch (e) { } catch (e) {
@ -22,7 +22,7 @@ describe('item lastEntriesFilter()', () => {
} }
}); });
it('should return five entries for the given item', async() => { it('should return six entries for the given item', async() => {
const minDate = Date.vnNew(); const minDate = Date.vnNew();
minDate.setHours(0, 0, 0, 0); minDate.setHours(0, 0, 0, 0);
minDate.setMonth(minDate.getMonth() - 2, 1); minDate.setMonth(minDate.getMonth() - 2, 1);
@ -37,7 +37,7 @@ describe('item lastEntriesFilter()', () => {
const filter = {where: {itemFk: 1, landed: {between: [minDate, maxDate]}}}; const filter = {where: {itemFk: 1, landed: {between: [minDate, maxDate]}}};
const result = await models.Item.lastEntriesFilter(filter, options); const result = await models.Item.lastEntriesFilter(filter, options);
expect(result.length).toEqual(5); expect(result.length).toEqual(6);
await tx.rollback(); await tx.rollback();
} catch (e) { } catch (e) {