1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

fix select.test.tsx

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2022-04-07 15:57:43 -04:00
parent 4bf4089346
commit dc3dffc2fc
3 changed files with 8 additions and 4 deletions

View File

@ -122,7 +122,7 @@ describe("<Select />", () => {
const { container, rerender } = render(<Select
value={options[0]}
onChange={onChange}
options={options}
options={options}
/>);
const selectedValueContainer = container.querySelector(".Select__single-value");

View File

@ -14,7 +14,6 @@ import ReactSelect, { components } from "react-select";
import type { Props as ReactSelectProps, GroupBase } from "react-select";
import { ThemeStore } from "../../theme.store";
import { autoBind, cssNames } from "../../utils";
import { merge } from "lodash";
const { Menu } = components;
@ -65,6 +64,7 @@ export class Select<Option, IsMulti extends boolean = false, Group extends Group
menuClass,
components = {},
styles,
value = null,
...props
} = this.props;
const WrappedMenu = components.Menu ?? Menu;
@ -72,12 +72,14 @@ export class Select<Option, IsMulti extends boolean = false, Group extends Group
return (
<ReactSelect
{...props}
styles={merge(styles, {
styles={{
menuPortal: styles => ({
...styles,
zIndex: "auto",
}),
})}
...styles,
}}
value={value}
onKeyDown={this.onKeyDown}
className={cssNames("Select", this.themeClass, className)}
classNamePrefix="Select"

View File

@ -34,6 +34,7 @@ import joinPathsInjectable from "../common/path/join-paths.injectable";
import { joinPathsFake } from "../common/test-utils/join-paths-fake";
import hotbarStoreInjectable from "../common/hotbar-store.injectable";
import terminalSpawningPoolInjectable from "./components/dock/terminal/terminal-spawning-pool.injectable";
import hostedClusterIdInjectable from "../common/cluster-store/hosted-cluster-id.injectable";
export const getDiForUnitTesting = (
{ doGeneralOverrides } = { doGeneralOverrides: false },
@ -59,6 +60,7 @@ export const getDiForUnitTesting = (
di.override(isLinuxInjectable, () => false);
di.override(terminalSpawningPoolInjectable, () => new HTMLElement());
di.override(hostedClusterIdInjectable, () => undefined);
di.override(getAbsolutePathInjectable, () => getAbsolutePathFake);
di.override(joinPathsInjectable, () => joinPathsFake);