From df1555185dbc7bfb8b7b8f95f0c3143b28443c78 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 14 Sep 2021 16:54:42 +0100 Subject: [PATCH] Changing over to using timestamps. --- packages/server/src/api/controllers/automation.js | 2 +- packages/server/src/api/routes/tests/metadata.spec.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/server/src/api/controllers/automation.js b/packages/server/src/api/controllers/automation.js index d0c0ac4e69..60a0928e33 100644 --- a/packages/server/src/api/controllers/automation.js +++ b/packages/server/src/api/controllers/automation.js @@ -205,7 +205,7 @@ exports.test = async function (ctx) { // save a test history run await updateTestHistory(ctx.appId, automation, { ...ctx.request.body, - occurredAt: new Date().toISOString(), + occurredAt: new Date().getTime(), }) await clearTestFlag(automation._id) ctx.body = response diff --git a/packages/server/src/api/routes/tests/metadata.spec.js b/packages/server/src/api/routes/tests/metadata.spec.js index 68a7b5dbd3..5befd492a2 100644 --- a/packages/server/src/api/routes/tests/metadata.spec.js +++ b/packages/server/src/api/routes/tests/metadata.spec.js @@ -46,6 +46,7 @@ describe("/metadata", () => { const metadata = await getMetadata(MetadataTypes.AUTOMATION_TEST_HISTORY) expect(metadata).toBeDefined() expect(metadata.history.length).toBe(1) + expect(typeof metadata.history[0].occurredAt).toBe("number") }) })