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

This commit is contained in:
jenkins-bot 2017-06-07 19:33:16 +00:00 committed by Gerrit Code Review
commit b0b10fff92
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.'
);
} );