mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-28 01:10:04 +00:00
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:
parent
39672c5f49
commit
98864a7ce3
BIN
resources/dist/index.js
vendored
BIN
resources/dist/index.js
vendored
Binary file not shown.
BIN
resources/dist/index.js.map
vendored
BIN
resources/dist/index.js.map
vendored
Binary file not shown.
|
@ -280,9 +280,9 @@ module.exports = function ( state, action ) {
|
||||||
|
|
||||||
case actionTypes.SETTINGS_SHOW:
|
case actionTypes.SETTINGS_SHOW:
|
||||||
return nextState( state, {
|
return nextState( state, {
|
||||||
event: {
|
event: createEvent( state.interaction, {
|
||||||
action: 'tapped settings cog'
|
action: 'tapped settings cog'
|
||||||
}
|
} )
|
||||||
} );
|
} );
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -584,9 +584,39 @@ QUnit.test( 'PREVIEW_DWELL', function ( assert ) {
|
||||||
} );
|
} );
|
||||||
|
|
||||||
QUnit.test( 'SETTINGS_SHOW should enqueue a "tapped settings cog" event', function ( assert ) {
|
QUnit.test( 'SETTINGS_SHOW should enqueue a "tapped settings cog" event', function ( assert ) {
|
||||||
var state = {
|
var initialState = {
|
||||||
interaction: {}
|
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, {
|
state = eventLogging( state, {
|
||||||
type: 'SETTINGS_SHOW'
|
type: 'SETTINGS_SHOW'
|
||||||
|
@ -595,8 +625,12 @@ QUnit.test( 'SETTINGS_SHOW should enqueue a "tapped settings cog" event', functi
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
state.event,
|
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.'
|
||||||
);
|
);
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue