refactor: Update Date.test.ts to use Date objects instead of formatted strings

This commit is contained in:
Simon Larsen
2024-08-07 12:50:45 -06:00
parent 491b89cbb4
commit 1ed9dfc429
2 changed files with 3 additions and 7 deletions

View File

@@ -32,12 +32,9 @@ describe("DatabaseDate", () => {
DatabaseDate.asDateStartOfTheDayEndOfTheDayForDatabaseQuery(
inputDate,
).toJSON();
const expectedStart: string = moment(inputDate)
.startOf("day")
.format("YYYY-MM-DD HH:mm:ss");
const expectedEnd: string = moment(inputDate)
.endOf("day")
.format("YYYY-MM-DD HH:mm:ss");
const expectedStart: Date = moment(inputDate).startOf("day").toDate();
const expectedEnd: Date = moment(inputDate).endOf("day").toDate();
expect(result).toEqual({
startValue: expectedStart,
endValue: expectedEnd,

View File

@@ -234,7 +234,6 @@ export default class BaseAnalyticsAPI<
let groupBy: GroupBy<AnalyticsDataModel> = {};
if (req.body) {
query = JSONFunctions.deserialize(
req.body["query"],
) as Query<AnalyticsDataModel>;