feat(metrics): Add Glean metrics for "set password" screen for third party auth

This commit is contained in:
Vijay Budhram 2024-06-21 12:35:43 -04:00
Родитель 25e15d2de2
Коммит a435d98616
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 9778545895B2532B
3 изменённых файлов: 18 добавлений и 18 удалений

Просмотреть файл

@ -253,16 +253,16 @@ const recordEventMetric = (eventName: string, properties: EventProperties) => {
case 'cad_mobile_pair_view': case 'cad_mobile_pair_view':
cadMobilePair.view.record(); cadMobilePair.view.record();
break; break;
case 'set_password_third_party_auth_view': case 'third_party_auth_set_password_view':
setPasswordThirdPartyAuth.view.record(); setPasswordThirdPartyAuth.view.record();
break; break;
case 'set_password_third_party_auth_engage': case 'third_party_auth_set_password_engage':
setPasswordThirdPartyAuth.engage.record(); setPasswordThirdPartyAuth.engage.record();
break; break;
case 'set_password_third_party_auth_submit': case 'third_party_auth_set_password_submit':
setPasswordThirdPartyAuth.submit.record(); setPasswordThirdPartyAuth.submit.record();
break; break;
case 'set_password_third_party_auth_success': case 'third_party_auth_set_password_success':
setPasswordThirdPartyAuth.success.record(); setPasswordThirdPartyAuth.success.record();
break; break;
} }
@ -378,10 +378,10 @@ export const GleanMetrics = {
view: createEventFn('cad_approve_device_view'), view: createEventFn('cad_approve_device_view'),
}, },
setPasswordThirdPartyAuth: { setPasswordThirdPartyAuth: {
view: createEventFn('set_password_third_party_auth_view'), view: createEventFn('third_party_auth_set_password_view'),
engage: createEventFn('set_password_third_party_auth_engage'), engage: createEventFn('third_party_auth_set_password_engage'),
submit: createEventFn('set_password_third_party_auth_submit'), submit: createEventFn('third_party_auth_set_password_submit'),
success: createEventFn('set_password_third_party_auth_success'), success: createEventFn('third_party_auth_set_password_success'),
}, },
}; };

Просмотреть файл

@ -457,40 +457,40 @@ describe('lib/glean', () => {
}); });
}); });
describe('set_password_third_party_auth', () => { describe('third_party_auth_set_password', () => {
it('submits a ping with the set_password_third_party_auth_view event name', async () => { it('submits a ping with the third_party_auth_set_password_view event name', async () => {
await GleanMetrics.setPasswordThirdPartyAuth.view(); await GleanMetrics.setPasswordThirdPartyAuth.view();
sinon.assert.calledOnce(setEventNameStub); sinon.assert.calledOnce(setEventNameStub);
sinon.assert.calledWith( sinon.assert.calledWith(
setEventNameStub, setEventNameStub,
'set_password_third_party_auth_view' 'third_party_auth_set_password_view'
); );
}); });
it('submits a ping with the set_password_third_party_auth_engage event name', async () => { it('submits a ping with the third_party_auth_set_password_engage event name', async () => {
await GleanMetrics.setPasswordThirdPartyAuth.engage(); await GleanMetrics.setPasswordThirdPartyAuth.engage();
sinon.assert.calledOnce(setEventNameStub); sinon.assert.calledOnce(setEventNameStub);
sinon.assert.calledWith( sinon.assert.calledWith(
setEventNameStub, setEventNameStub,
'set_password_third_party_auth_engage' 'third_party_auth_set_password_engage'
); );
}); });
it('submits a ping with the set_password_third_party_auth_submit event name', async () => { it('submits a ping with the third_party_auth_set_password_submit event name', async () => {
await GleanMetrics.setPasswordThirdPartyAuth.submit(); await GleanMetrics.setPasswordThirdPartyAuth.submit();
sinon.assert.calledOnce(setEventNameStub); sinon.assert.calledOnce(setEventNameStub);
sinon.assert.calledWith( sinon.assert.calledWith(
setEventNameStub, setEventNameStub,
'set_password_third_party_auth_submit' 'third_party_auth_set_password_submit'
); );
}); });
it('submits a ping with the set_password_third_party_auth_success event name', async () => { it('submits a ping with the third_party_auth_set_password_success event name', async () => {
await GleanMetrics.setPasswordThirdPartyAuth.success(); await GleanMetrics.setPasswordThirdPartyAuth.success();
sinon.assert.calledOnce(setEventNameStub); sinon.assert.calledOnce(setEventNameStub);
sinon.assert.calledWith( sinon.assert.calledWith(
setEventNameStub, setEventNameStub,
'set_password_third_party_auth_success' 'third_party_auth_set_password_success'
); );
}); });
}); });

Просмотреть файл

@ -1300,7 +1300,7 @@ cad_mobile_pair:
data_sensitivity: data_sensitivity:
- interaction - interaction
set_password_third_party_auth: third_party_auth_set_password:
view: view:
type: event type: event
description: | description: |