fixed unit test for weekends
gitea/salix/dev This commit looks good Details

This commit is contained in:
Joan Sanchez 2019-07-05 11:18:08 +02:00
parent 061f0cb39c
commit 8ec61bf31f
1 changed files with 1 additions and 4 deletions

View File

@ -20,7 +20,6 @@ describe('agency editPrices()', () => {
it('should apply price and bonus for a selected day', async() => {
const delivered = new Date();
delivered.setHours(0, 0, 0, 0);
delivered.setDate(delivered.getDate() + 1);
await app.models.Zone.editPrices(zoneId, delivered, 4.00, 2.00, 'Only this day');
const editedDays = await app.models.ZoneCalendar.find({
@ -39,7 +38,6 @@ describe('agency editPrices()', () => {
it('should apply price and bonus for all delivery days starting from selected day', async() => {
const delivered = new Date();
delivered.setHours(0, 0, 0, 0);
delivered.setDate(delivered.getDate() + 1);
await app.models.Zone.editPrices(1, delivered, 5.50, 1.00, 'From this day');
const editedDays = await app.models.ZoneCalendar.find({
@ -53,7 +51,7 @@ describe('agency editPrices()', () => {
const firstEditedDay = editedDays[0];
const lastEditedDay = editedDays[editedDays.length - 1];
expect(editedDays.length).toEqual(4);
expect(editedDays.length).toEqual(5);
expect(firstEditedDay.price).toEqual(5.50);
expect(firstEditedDay.bonus).toEqual(1.00);
expect(lastEditedDay.price).toEqual(5.50);
@ -63,7 +61,6 @@ describe('agency editPrices()', () => {
it('should apply price and bonus for all delivery days', async() => {
const delivered = new Date();
delivered.setHours(0, 0, 0, 0);
delivered.setDate(delivered.getDate() + 1);
await app.models.Zone.editPrices(1, delivered, 7.00, 0.00, 'All days');
const editedDays = await app.models.ZoneCalendar.find({