diff --git a/ui/src/Components/MultiSelect/__snapshots__/index.test.js.snap b/ui/src/Components/MultiSelect/__snapshots__/index.test.js.snap new file mode 100644 index 000000000..90a223121 --- /dev/null +++ b/ui/src/Components/MultiSelect/__snapshots__/index.test.js.snap @@ -0,0 +1,105 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` matches snapshot with a value 1`] = ` + +`; + +exports[` matches snapshot with defaults 1`] = ` + +`; + +exports[` matches snapshot with isMulti=true 1`] = ` + +`; + +exports[` matches snapshot with isMulti=true and a value 1`] = ` + +`; diff --git a/ui/src/Components/MultiSelect/index.test.js b/ui/src/Components/MultiSelect/index.test.js new file mode 100644 index 000000000..9858134f6 --- /dev/null +++ b/ui/src/Components/MultiSelect/index.test.js @@ -0,0 +1,49 @@ +import React from "react"; + +import { shallow } from "enzyme"; + +import { MultiSelect } from "."; + +const Option = value => ({ label: value, value: value }); + +class CustomMultiSelect extends MultiSelect { + constructor(props) { + super(props); + this.extraProps = props; + } + + renderProps = () => this.extraProps; +} + +describe("", () => { + it("matches snapshot with defaults", () => { + const tree = shallow(); + expect(tree).toMatchSnapshot(); + }); + + it("matches snapshot with isMulti=true", () => { + const tree = shallow(); + expect(tree).toMatchSnapshot(); + }); + + it("matches snapshot with a value", () => { + const tree = shallow( + + ); + expect(tree).toMatchSnapshot(); + }); + + it("matches snapshot with isMulti=true and a value", () => { + const tree = shallow( + + ); + expect(tree).toMatchSnapshot(); + }); +});