Add enough code to get first couple terminal tests to pass

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2023-01-10 15:17:50 -05:00
1 parent 87dc14cbfb
commit dba4f59644
54 files changed
+1338 -378

No files matched your search

@@ -0,0 +1,11 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getGlobalOverride } from "../../../common/test-utils/get-global-override";
import showErrorPopupInjectable from "./show-error-popup.injectable";
export default getGlobalOverride(showErrorPopupInjectable, () => () => {
throw new Error("Tried to show an error popup without an override");
});
@@ -5,15 +5,15 @@
import { getInjectable } from "@ogre-tools/injectable";
import electronDialogInjectable from "./electron-dialog.injectable";
export type ShowErrorPopup = (heading: string, message: string) => void;
const showErrorPopupInjectable = getInjectable({
id: "show-error-popup",
instantiate: (di) => {
instantiate: (di): ShowErrorPopup => {
const dialog = di.inject(electronDialogInjectable);
return (heading: string, message: string) => {
dialog.showErrorBox(heading, message);
};
return (heading, message) => dialog.showErrorBox(heading, message);
},
});