function createStubTitle( fragment = null ) { return { getFragment() { return fragment; } }; } ( mw.loader.getModuleNames().indexOf( 'ext.popups.main' ) !== -1 ? QUnit.module : QUnit.module.skip )( 'ext.cite.referencePreviews#createReferenceGateway', { beforeEach() { // FIXME: Is this needed? // global.CSS = { // escape: ( str ) => $.escapeSelector( str ) // }; mw.msg = ( key ) => `<${ key }>`; mw.message = ( key ) => ( { exists: () => !key.endsWith( 'generic' ), text: () => `<${ key }>` } ); this.$sourceElement = $( '' ).appendTo( $( '' ).attr( 'id', 'cite_ref-1' ).appendTo( document.body ) ); this.$references = $( '