diff --git a/blocks/api/parser.js b/blocks/api/parser.js index ac93a9448862c8..28f870993cf0e6 100644 --- a/blocks/api/parser.js +++ b/blocks/api/parser.js @@ -4,6 +4,11 @@ import { parse as hpqParse } from 'hpq'; import { pickBy } from 'lodash'; +/** + * WordPress dependencies + */ +import { bumpStat } from '@wordpress/utils'; + /** * Internal dependencies */ @@ -75,6 +80,7 @@ export function createBlockWithFallback( name, rawContent, attributes ) { // Convert 'core/text' blocks in existing content to the new // 'core/paragraph'. if ( name === 'core/text' ) { + bumpStat( 'block_auto_convert', 'core-text-to-paragraph' ); name = 'core/paragraph'; } diff --git a/test/setup-globals.js b/test/setup-globals.js index 931f6e146d7985..d5a8ed265c7899 100644 --- a/test/setup-globals.js +++ b/test/setup-globals.js @@ -51,3 +51,14 @@ global.wp = global.wp || {}; global.wp.a11y = { speak: () => {}, }; + +global.window.getUserSetting = settingName => { + switch ( settingName ) { + case 'gutenberg_tracking': + return 'on'; + default: + throw new Error( + 'Unrecognized user setting requested: ' + settingName + ); + } +};