eventLogging: Add missing properties to "tapped settings cog" event

When there's an interaction, then the "tapped settings cog" event should
have the same properties set as the other interaction-specific events.

This was discovered while QAing T164256.

Bug: T164256
Change-Id: I4749b52656203c7e0c42ae742556ee996eee322a
This commit is contained in:
Sam Smith 2017-06-07 10:12:23 +01:00
parent 39672c5f49
commit 98864a7ce3
4 changed files with 41 additions and 7 deletions

Binary file not shown.

Binary file not shown.

View file

@ -280,9 +280,9 @@ module.exports = function ( state, action ) {
case actionTypes.SETTINGS_SHOW:
return nextState( state, {
event: {
event: createEvent( state.interaction, {
action: 'tapped settings cog'
}
} )
} );
default:

View file

@ -584,9 +584,39 @@ QUnit.test( 'PREVIEW_DWELL', function ( assert ) {
} );
QUnit.test( 'SETTINGS_SHOW should enqueue a "tapped settings cog" event', function ( assert ) {
var state = {
interaction: {}
};
var initialState = {
interaction: {}
},
state,
token = '0123456789';
state = eventLogging( initialState, {
type: 'SETTINGS_SHOW'
} );
// Note well that this is a valid event. The "tapped settings cog" event is
// also logged as a result of clicking the footer link.
assert.deepEqual(
state.event,
{
action: 'tapped settings cog',
linkInteractionToken: undefined,
namespaceIdHover: undefined,
pageTitleHover: undefined
},
'It shouldn\'t fail if there\'s no interaction.'
);
// ---
state = eventLogging( initialState, {
type: 'LINK_DWELL',
el: this.link,
title: 'Foo',
namespaceID: 1,
token: token,
timestamp: Date.now()
} );
state = eventLogging( state, {
type: 'SETTINGS_SHOW'
@ -595,8 +625,12 @@ QUnit.test( 'SETTINGS_SHOW should enqueue a "tapped settings cog" event', functi
assert.deepEqual(
state.event,
{
action: 'tapped settings cog'
}
action: 'tapped settings cog',
linkInteractionToken: token,
namespaceIdHover: 1,
pageTitleHover: 'Foo'
},
'It should include the interaction information if there\'s an interaction.'
);
} );