mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
appPublishDate initial test
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
6dadbd30a4
commit
c9f105405f
@ -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("");
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -4,12 +4,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
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({
|
const appPublishDateInjectable = getInjectable({
|
||||||
id: "app-publish-date",
|
id: "app-publish-date",
|
||||||
|
|
||||||
instantiate: () => {
|
instantiate: (di) => {
|
||||||
return "Wed, 04 May 2022 02:35:00 +0300";
|
return appPublishDate(di.inject(appVersionInjectable));
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
8
src/renderer/app-update-warning/app-publish-date.ts
Normal file
8
src/renderer/app-update-warning/app-publish-date.ts
Normal file
@ -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 "";
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user