diff --git a/src/renderer/app-update-warning/__tests__/app-publish-date.test.ts b/src/renderer/app-update-warning/__tests__/app-publish-date.test.ts new file mode 100644 index 0000000000..6d6507f40d --- /dev/null +++ b/src/renderer/app-update-warning/__tests__/app-publish-date.test.ts @@ -0,0 +1,20 @@ +/** + * Copyright (c) OpenLens Authors. All rights reserved. + * Licensed under MIT License. See LICENSE in root directory for more information. + */ + +import appVersionInjectable from "../../../common/get-configuration-file-model/app-version/app-version.injectable"; +import { getDiForUnitTesting } from "../../getDiForUnitTesting"; +import appPublishDateInjectable from "../app-publish-date.injectable"; + +describe("appPublishDate", () => { + const di = getDiForUnitTesting({ doGeneralOverrides: true }); + + it("should return empty string if appVersion is not provided", () => { + di.override(appVersionInjectable, () => ""); + + const appPublishDate = di.inject(appPublishDateInjectable); + + expect(appPublishDate).toBe(""); + }); +}); diff --git a/src/renderer/app-update-warning/app-publish-date.injectable.ts b/src/renderer/app-update-warning/app-publish-date.injectable.ts index 07fd3fccae..2b5ae34a4f 100644 --- a/src/renderer/app-update-warning/app-publish-date.injectable.ts +++ b/src/renderer/app-update-warning/app-publish-date.injectable.ts @@ -4,12 +4,14 @@ */ import { getInjectable } from "@ogre-tools/injectable"; +import appVersionInjectable from "../../common/get-configuration-file-model/app-version/app-version.injectable"; +import { appPublishDate } from "./app-publish-date"; const appPublishDateInjectable = getInjectable({ id: "app-publish-date", - instantiate: () => { - return "Wed, 04 May 2022 02:35:00 +0300"; + instantiate: (di) => { + return appPublishDate(di.inject(appVersionInjectable)); }, }); diff --git a/src/renderer/app-update-warning/app-publish-date.ts b/src/renderer/app-update-warning/app-publish-date.ts new file mode 100644 index 0000000000..cd08d07a97 --- /dev/null +++ b/src/renderer/app-update-warning/app-publish-date.ts @@ -0,0 +1,8 @@ +/** + * Copyright (c) OpenLens Authors. All rights reserved. + * Licensed under MIT License. See LICENSE in root directory for more information. + */ + +export function appPublishDate(appVersion: string) { + return ""; +}