diff --git a/tests/qunit/ext.cite.referencePreviews/createReferenceGateway.test.js b/tests/qunit/ext.cite.referencePreviews/createReferenceGateway.test.js index f906ef2cc..740346e17 100644 --- a/tests/qunit/ext.cite.referencePreviews/createReferenceGateway.test.js +++ b/tests/qunit/ext.cite.referencePreviews/createReferenceGateway.test.js @@ -1,174 +1,186 @@ -function createStubTitle( fragment = null ) { - return { - getFragment() { - return fragment; - } - }; -} +'use strict'; -( 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 = $( '