'use strict'; ( function () { 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: function () { this.sandbox.stub( mw, 'msg', ( key ) => `<${ key }>` ); this.sandbox.stub( mw, 'message', ( key ) => ( { exists: () => !key.endsWith( 'generic' ), text: () => `<${ key }>` } ) ); this.$sourceElement = $( '' ).appendTo( $( '' ).attr( 'id', 'cite_ref-1' ).appendTo( document.body ) ); this.$references = $( '