mirror of
https://github.com/prymitive/karma
synced 2026-05-09 03:36:44 +00:00
Merge pull request #746 from prymitive/author-email
fix(ui): allow any string as silence author, not just email
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -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");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user