diff --git a/ui/src/Components/MultiSelect/index.js b/ui/src/Components/MultiSelect/index.js
deleted file mode 100644
index 9e9bf2e94..000000000
--- a/ui/src/Components/MultiSelect/index.js
+++ /dev/null
@@ -1,22 +0,0 @@
-import React from "react";
-
-import Creatable from "react-select/creatable";
-
-import { ThemeContext } from "Components/Theme";
-
-class MultiSelect extends Creatable {
- renderProps = () => ({});
-
- render() {
- return (
-
- );
- }
-}
-MultiSelect.contextType = ThemeContext;
-
-export { MultiSelect };
diff --git a/ui/src/Components/SilenceModal/AlertManagerInput/index.js b/ui/src/Components/SilenceModal/AlertManagerInput/index.js
index 8a5bf751b..65d56e9ed 100644
--- a/ui/src/Components/SilenceModal/AlertManagerInput/index.js
+++ b/ui/src/Components/SilenceModal/AlertManagerInput/index.js
@@ -12,7 +12,7 @@ import {
AlertmanagerClustersToOption,
} from "Stores/SilenceFormStore";
import { ThemeContext } from "Components/Theme";
-import { ValidationError } from "Components/MultiSelect/ValidationError";
+import { ValidationError } from "Components/ValidationError";
const AlertManagerInput = ({ alertStore, silenceFormStore }) => {
useEffect(() => {
diff --git a/ui/src/Components/SilenceModal/SilenceMatch/LabelNameInput.js b/ui/src/Components/SilenceModal/SilenceMatch/LabelNameInput.js
index 83edbb7ae..d99b390f5 100644
--- a/ui/src/Components/SilenceModal/SilenceMatch/LabelNameInput.js
+++ b/ui/src/Components/SilenceModal/SilenceMatch/LabelNameInput.js
@@ -6,7 +6,7 @@ import Creatable from "react-select/creatable";
import { SilenceFormMatcher } from "Models/SilenceForm";
import { FormatBackendURI } from "Stores/AlertStore";
import { useFetchGet } from "Hooks/useFetchGet";
-import { ValidationError } from "Components/MultiSelect/ValidationError";
+import { ValidationError } from "Components/ValidationError";
import { ThemeContext } from "Components/Theme";
const LabelNameInput = ({ matcher, isValid }) => {
diff --git a/ui/src/Components/SilenceModal/SilenceMatch/LabelValueInput.js b/ui/src/Components/SilenceModal/SilenceMatch/LabelValueInput.js
index f1a1d9f2f..43cfb0c06 100644
--- a/ui/src/Components/SilenceModal/SilenceMatch/LabelValueInput.js
+++ b/ui/src/Components/SilenceModal/SilenceMatch/LabelValueInput.js
@@ -13,7 +13,7 @@ import { FormatBackendURI } from "Stores/AlertStore";
import { SilenceFormStore } from "Stores/SilenceFormStore";
import { SilenceFormMatcher } from "Models/SilenceForm";
import { useFetchGet } from "Hooks/useFetchGet";
-import { ValidationError } from "Components/MultiSelect/ValidationError";
+import { ValidationError } from "Components/ValidationError";
import { ThemeContext } from "Components/Theme";
import { MatchCounter } from "./MatchCounter";
diff --git a/ui/src/Components/MultiSelect/index.test.js b/ui/src/Components/Theme/ReactSelect.test.js
similarity index 55%
rename from ui/src/Components/MultiSelect/index.test.js
rename to ui/src/Components/Theme/ReactSelect.test.js
index b82eaf769..e3dc01f3d 100644
--- a/ui/src/Components/MultiSelect/index.test.js
+++ b/ui/src/Components/Theme/ReactSelect.test.js
@@ -4,65 +4,35 @@ import { mount } from "enzyme";
import toDiffableHtml from "diffable-html";
-import { ThemeContext } from "Components/Theme";
+import Select from "react-select";
+
import {
ReactSelectColors,
ReactSelectStyles,
} from "Components/Theme/ReactSelect";
-import { MultiSelect } from ".";
const Option = (value) => ({ label: value, value: value });
-const Wrapped = (component) => (
-
- {component}
-
+const ThemedSelect = (props) => (
+
);
-describe(" ", () => {
- it("matches snapshot without any extra props", () => {
- const tree = mount(Wrapped( ));
- expect(toDiffableHtml(tree.html())).toMatchSnapshot();
- });
-});
-
-class CustomMultiSelect extends MultiSelect {
- constructor(props) {
- super(props);
- this.extraProps = props;
- }
-
- renderProps = () => this.extraProps;
-}
-
-const WrappedCustomMultiSelect = (props) =>
- Wrapped( );
-
describe(" ", () => {
- it("matches snapshot with defaults", () => {
- const tree = mount( );
- expect(toDiffableHtml(tree.html())).toMatchSnapshot();
- });
-
it("matches snapshot with isMulti=true", () => {
- const tree = mount( );
+ const tree = mount( );
expect(toDiffableHtml(tree.html())).toMatchSnapshot();
});
it("matches snapshot when focused", () => {
// this test is to cover styles state.isFocused conditions
- const tree = mount( );
+ const tree = mount( );
tree.find("input").simulate("focus");
expect(toDiffableHtml(tree.html())).toMatchSnapshot();
});
it("matches snapshot with a value", () => {
const tree = mount(
-
@@ -72,7 +42,7 @@ describe(" ", () => {
it("matches snapshot with isMulti=true and a value", () => {
const tree = mount(
- ", () => {
it("matches snapshot with isDisabled=true", () => {
const tree = mount(
- matches snapshot without any extra props 1`] = `
-"
-
-"
-`;
-
exports[` matches snapshot when focused 1`] = `
"
@@ -64,19 +13,19 @@ exports[`
matches snapshot when focused 1`] = `
0 results available. Select is focused ,type to refine list, press Down to open the menu,
-
-
-
+
+
-
-
+
+
matches snapshot when focused 1`] = `
exports[`
matches snapshot with a value 1`] = `
"
-
-
-
+
-"
-`;
-
-exports[`
matches snapshot with defaults 1`] = `
-"
-
-
-
-
-
-
-
matches snapshot with defaults 1`] = `
exports[`
matches snapshot with isDisabled=true 1`] = `
"
-
-
-
-
+
+
+
-
-
+
+
matches snapshot with isDisabled=true 1`]
exports[`
matches snapshot with isMulti=true 1`] = `
"
-
-
-
+
+
-
-
+
+
matches snapshot with isMulti=true 1`] = `
exports[`
matches snapshot with isMulti=true and a value 1`] = `
"
-
-
-
-
+
+
+
+
foo
-
+
matches snapshot with isMulti=true and a v
-
+
matches snapshot with isMulti=true and a v
-
+
", () => {
it("matches snapshot", () => {