Fix Bug 1515663 - Block FxA snippet on form submit (#4635)
This commit is contained in:
Родитель
06fbd77770
Коммит
c56b04a79e
|
@ -38,6 +38,7 @@ export class SubmitFormSnippet extends React.PureComponent {
|
|||
this.props.sendUserActionTelemetry({event: "CLICK_BUTTON", value: "conversion-subscribe-activation", id: "NEWTAB_FOOTER_BAR_CONTENT"});
|
||||
|
||||
if (this.props.form_method.toUpperCase() === "GET") {
|
||||
this.props.onBlock({preventDismiss: true});
|
||||
this.refs.form.submit();
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -249,5 +249,14 @@ describe("SubmitFormSnippet", () => {
|
|||
|
||||
assert.notCalled(window.fetch);
|
||||
});
|
||||
it("should block the snippet when form_method is GET", () => {
|
||||
wrapper.setProps({form_method: "GET"});
|
||||
wrapper.setState({expanded: true});
|
||||
|
||||
wrapper.instance().handleSubmit({preventDefault: sandbox.stub()});
|
||||
|
||||
assert.calledOnce(onBlockStub);
|
||||
assert.calledWithExactly(onBlockStub, {preventDismiss: true});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче