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:
parent
4bf4089346
commit
dc3dffc2fc
@ -122,7 +122,7 @@ describe("<Select />", () => {
|
|||||||
const { container, rerender } = render(<Select
|
const { container, rerender } = render(<Select
|
||||||
value={options[0]}
|
value={options[0]}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
options={options}
|
options={options}
|
||||||
/>);
|
/>);
|
||||||
const selectedValueContainer = container.querySelector(".Select__single-value");
|
const selectedValueContainer = container.querySelector(".Select__single-value");
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,6 @@ import ReactSelect, { components } from "react-select";
|
|||||||
import type { Props as ReactSelectProps, GroupBase } from "react-select";
|
import type { Props as ReactSelectProps, GroupBase } from "react-select";
|
||||||
import { ThemeStore } from "../../theme.store";
|
import { ThemeStore } from "../../theme.store";
|
||||||
import { autoBind, cssNames } from "../../utils";
|
import { autoBind, cssNames } from "../../utils";
|
||||||
import { merge } from "lodash";
|
|
||||||
|
|
||||||
const { Menu } = components;
|
const { Menu } = components;
|
||||||
|
|
||||||
@ -65,6 +64,7 @@ export class Select<Option, IsMulti extends boolean = false, Group extends Group
|
|||||||
menuClass,
|
menuClass,
|
||||||
components = {},
|
components = {},
|
||||||
styles,
|
styles,
|
||||||
|
value = null,
|
||||||
...props
|
...props
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const WrappedMenu = components.Menu ?? Menu;
|
const WrappedMenu = components.Menu ?? Menu;
|
||||||
@ -72,12 +72,14 @@ export class Select<Option, IsMulti extends boolean = false, Group extends Group
|
|||||||
return (
|
return (
|
||||||
<ReactSelect
|
<ReactSelect
|
||||||
{...props}
|
{...props}
|
||||||
styles={merge(styles, {
|
styles={{
|
||||||
menuPortal: styles => ({
|
menuPortal: styles => ({
|
||||||
...styles,
|
...styles,
|
||||||
zIndex: "auto",
|
zIndex: "auto",
|
||||||
}),
|
}),
|
||||||
})}
|
...styles,
|
||||||
|
}}
|
||||||
|
value={value}
|
||||||
onKeyDown={this.onKeyDown}
|
onKeyDown={this.onKeyDown}
|
||||||
className={cssNames("Select", this.themeClass, className)}
|
className={cssNames("Select", this.themeClass, className)}
|
||||||
classNamePrefix="Select"
|
classNamePrefix="Select"
|
||||||
|
|||||||
@ -34,6 +34,7 @@ import joinPathsInjectable from "../common/path/join-paths.injectable";
|
|||||||
import { joinPathsFake } from "../common/test-utils/join-paths-fake";
|
import { joinPathsFake } from "../common/test-utils/join-paths-fake";
|
||||||
import hotbarStoreInjectable from "../common/hotbar-store.injectable";
|
import hotbarStoreInjectable from "../common/hotbar-store.injectable";
|
||||||
import terminalSpawningPoolInjectable from "./components/dock/terminal/terminal-spawning-pool.injectable";
|
import terminalSpawningPoolInjectable from "./components/dock/terminal/terminal-spawning-pool.injectable";
|
||||||
|
import hostedClusterIdInjectable from "../common/cluster-store/hosted-cluster-id.injectable";
|
||||||
|
|
||||||
export const getDiForUnitTesting = (
|
export const getDiForUnitTesting = (
|
||||||
{ doGeneralOverrides } = { doGeneralOverrides: false },
|
{ doGeneralOverrides } = { doGeneralOverrides: false },
|
||||||
@ -59,6 +60,7 @@ export const getDiForUnitTesting = (
|
|||||||
di.override(isLinuxInjectable, () => false);
|
di.override(isLinuxInjectable, () => false);
|
||||||
|
|
||||||
di.override(terminalSpawningPoolInjectable, () => new HTMLElement());
|
di.override(terminalSpawningPoolInjectable, () => new HTMLElement());
|
||||||
|
di.override(hostedClusterIdInjectable, () => undefined);
|
||||||
|
|
||||||
di.override(getAbsolutePathInjectable, () => getAbsolutePathFake);
|
di.override(getAbsolutePathInjectable, () => getAbsolutePathFake);
|
||||||
di.override(joinPathsInjectable, () => joinPathsFake);
|
di.override(joinPathsInjectable, () => joinPathsFake);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user