fix: deal ticket dates set to next day (#2035)

* fix: deal ticket dates set to next day

* fix: fix
This commit is contained in:
Radosław Szpiech 2022-11-11 14:28:55 +01:00 committed by GitHub
parent 3df69788fb
commit bae5d6069a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,6 +77,12 @@ const mockTx = {
},
};
const displayTomorrow = () => {
const tomorrow = new Date();
tomorrow.setDate(tomorrow.getDate() + 1);
return tomorrow.toISOString().substring(0, 16);
};
const testOrder = (order: Order, expected?: Partial<Order>) => {
const { type, side, size, price, timeInForce, expiresAt } = order;
@ -288,7 +294,7 @@ describe(
size: '100',
price: '1.00',
timeInForce: 'TIME_IN_FORCE_GTT',
expiresAt: '2022-01-01T00:00',
expiresAt: displayTomorrow(),
};
testOrder(order, {
price: '100000',
@ -347,7 +353,7 @@ describe(
size: '100',
price: '1.00',
timeInForce: 'TIME_IN_FORCE_GTT',
expiresAt: '2022-01-01T00:00',
expiresAt: displayTomorrow(),
};
testOrder(order, {
price: '100000',
@ -406,7 +412,7 @@ describe(
size: '100',
price: '1.00',
timeInForce: 'TIME_IN_FORCE_GTT',
expiresAt: '2022-01-01T00:00',
expiresAt: displayTomorrow(),
};
testOrder(order, {
price: '100000',