Update tests
parent
a2aca364dd
commit
36084c7012
|
@ -154,12 +154,6 @@ describe("<FrontPage />", () => {
|
|||
}
|
||||
}
|
||||
}
|
||||
const loginPassword = setField("loginPassword", spy)
|
||||
const event1 = fakeEv({ defaultValue: "pw12" });
|
||||
const expected1 = {loginPassword: event1.currentTarget.defaultValue};
|
||||
loginPassword(event1);
|
||||
expect(spy).toHaveBeenCalledWith(expected1);
|
||||
jest.resetAllMocks();
|
||||
|
||||
const agreeToTerms = setField("agreeToTerms", spy)
|
||||
const event2 = fakeEv({ checked: false });
|
||||
|
@ -171,7 +165,7 @@ describe("<FrontPage />", () => {
|
|||
|
||||
const regName = setField("regName", spy)
|
||||
const event3 = fakeEv({ value: "hello!" });
|
||||
const expected3 = {regName: event3.currentTarget.value};
|
||||
const expected3 = { regName: event3.currentTarget.value };
|
||||
regName(event3);
|
||||
expect(spy).toHaveBeenCalledWith(expected3);
|
||||
jest.resetAllMocks();
|
||||
|
|
|
@ -44,7 +44,8 @@ export class BlurableInput extends React.Component<BIProps, Partial<BIState>> {
|
|||
const shouldPassToParent = this.state.buffer || (this.props.allowEmpty);
|
||||
shouldPassToParent && this.props.onCommit(e);
|
||||
this.setState({ isEditing: false, buffer: "" });
|
||||
e.currentTarget.setAttribute("value", ""); // Clear password fields
|
||||
const isPw = (this.props.type === "password");
|
||||
isPw && e.currentTarget.setAttribute("value", "");
|
||||
}
|
||||
|
||||
focus = () => {
|
||||
|
|
Loading…
Reference in New Issue