fixed unit test for weekends
gitea/salix/dev This commit looks good
Details
gitea/salix/dev This commit looks good
Details
This commit is contained in:
parent
061f0cb39c
commit
8ec61bf31f
|
@ -20,7 +20,6 @@ describe('agency editPrices()', () => {
|
||||||
it('should apply price and bonus for a selected day', async() => {
|
it('should apply price and bonus for a selected day', async() => {
|
||||||
const delivered = new Date();
|
const delivered = new Date();
|
||||||
delivered.setHours(0, 0, 0, 0);
|
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');
|
await app.models.Zone.editPrices(zoneId, delivered, 4.00, 2.00, 'Only this day');
|
||||||
|
|
||||||
const editedDays = await app.models.ZoneCalendar.find({
|
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() => {
|
it('should apply price and bonus for all delivery days starting from selected day', async() => {
|
||||||
const delivered = new Date();
|
const delivered = new Date();
|
||||||
delivered.setHours(0, 0, 0, 0);
|
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');
|
await app.models.Zone.editPrices(1, delivered, 5.50, 1.00, 'From this day');
|
||||||
|
|
||||||
const editedDays = await app.models.ZoneCalendar.find({
|
const editedDays = await app.models.ZoneCalendar.find({
|
||||||
|
@ -53,7 +51,7 @@ describe('agency editPrices()', () => {
|
||||||
const firstEditedDay = editedDays[0];
|
const firstEditedDay = editedDays[0];
|
||||||
const lastEditedDay = editedDays[editedDays.length - 1];
|
const lastEditedDay = editedDays[editedDays.length - 1];
|
||||||
|
|
||||||
expect(editedDays.length).toEqual(4);
|
expect(editedDays.length).toEqual(5);
|
||||||
expect(firstEditedDay.price).toEqual(5.50);
|
expect(firstEditedDay.price).toEqual(5.50);
|
||||||
expect(firstEditedDay.bonus).toEqual(1.00);
|
expect(firstEditedDay.bonus).toEqual(1.00);
|
||||||
expect(lastEditedDay.price).toEqual(5.50);
|
expect(lastEditedDay.price).toEqual(5.50);
|
||||||
|
@ -63,7 +61,6 @@ describe('agency editPrices()', () => {
|
||||||
it('should apply price and bonus for all delivery days', async() => {
|
it('should apply price and bonus for all delivery days', async() => {
|
||||||
const delivered = new Date();
|
const delivered = new Date();
|
||||||
delivered.setHours(0, 0, 0, 0);
|
delivered.setHours(0, 0, 0, 0);
|
||||||
delivered.setDate(delivered.getDate() + 1);
|
|
||||||
await app.models.Zone.editPrices(1, delivered, 7.00, 0.00, 'All days');
|
await app.models.Zone.editPrices(1, delivered, 7.00, 0.00, 'All days');
|
||||||
|
|
||||||
const editedDays = await app.models.ZoneCalendar.find({
|
const editedDays = await app.models.ZoneCalendar.find({
|
||||||
|
|
Loading…
Reference in New Issue