Merge pull request #746 from prymitive/author-email

fix(ui): allow any string as silence author, not just email
This commit is contained in:
Łukasz Mierzwa
2019-05-31 07:54:20 +01:00
committed by GitHub
2 changed files with 5 additions and 5 deletions

View File

@@ -162,9 +162,9 @@ const SilenceForm = observer(
</TooltipWrapper>
<DateTimeSelect silenceFormStore={silenceFormStore} />
<IconInput
type="email"
type="text"
autoComplete="email"
placeholder="Author email"
placeholder="Author"
icon={faUser}
value={silenceFormStore.data.author}
onChange={this.onAuthorChange}

View File

@@ -127,7 +127,7 @@ describe("<SilenceForm /> inputs", () => {
it("default author value comes from Settings store", () => {
settingsStore.silenceFormConfig.config.author = "foo@example.com";
const tree = MountedSilenceForm();
const input = tree.find("input[placeholder='Author email']");
const input = tree.find("input[placeholder='Author']");
expect(input.props().value).toBe("foo@example.com");
expect(silenceFormStore.data.author).toBe("foo@example.com");
});
@@ -135,14 +135,14 @@ describe("<SilenceForm /> inputs", () => {
it("default author value is empty if nothing is stored in Settings", () => {
settingsStore.silenceFormConfig.config.author = "";
const tree = MountedSilenceForm();
const input = tree.find("input[placeholder='Author email']");
const input = tree.find("input[placeholder='Author']");
expect(input.text()).toBe("");
expect(silenceFormStore.data.author).toBe("");
});
it("changing author input updates SilenceFormStore", () => {
const tree = MountedSilenceForm();
const input = tree.find("input[placeholder='Author email']");
const input = tree.find("input[placeholder='Author']");
input.simulate("change", { target: { value: "me@example.com" } });
expect(silenceFormStore.data.author).toBe("me@example.com");
});