Bug 1515026 - Add telemetry event for learn more button (#4648)
This commit is contained in:
Родитель
796f36c1dd
Коммит
8b65268c67
|
@ -71,6 +71,8 @@ export class SubmitFormSnippet extends React.PureComponent {
|
|||
}
|
||||
|
||||
expandSnippet() {
|
||||
this.props.sendUserActionTelemetry({event: "CLICK_BUTTON", value: "scene1-button-learn-more", id: this.props.UISurface});
|
||||
|
||||
this.setState({
|
||||
expanded: true,
|
||||
signupSuccess: false,
|
||||
|
|
|
@ -141,6 +141,13 @@ describe("SubmitFormSnippet", () => {
|
|||
assert.isTrue(wrapper.state().expanded);
|
||||
assert.isTrue(wrapper.find("form").exists());
|
||||
});
|
||||
it("should submit telemetry when the action button is clicked", () => {
|
||||
assert.isFalse(wrapper.find("form").exists());
|
||||
|
||||
wrapper.find(".ASRouterButton").simulate("click");
|
||||
|
||||
assert.equal(wrapper.props().sendUserActionTelemetry.firstCall.args[0].value, "scene1-button-learn-more");
|
||||
});
|
||||
it("should submit form data when submitted", () => {
|
||||
sandbox.stub(window, "fetch").resolves(fetchOk);
|
||||
wrapper.setState({expanded: true});
|
||||
|
|
Загрузка…
Ссылка в новой задаче