mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-09-24 18:59:14 +00:00
Rename getTitle.js to title.js
In order to create a title#shouldShowPreview function next in the module. Bug: T165572 Change-Id: I9e59bb0f525d2698f882543ca0d4a1bde6b2d5d2
This commit is contained in:
parent
b0b10fff92
commit
ef2f99ef65
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.
|
@ -4,7 +4,7 @@
|
|||
|
||||
var mw = window.mediaWiki,
|
||||
$ = jQuery,
|
||||
getTitle = require( './getTitle' );
|
||||
getTitle = require( './title' ).getTitle;
|
||||
|
||||
/**
|
||||
* Processes and returns link elements (or "`<a>`s") that are eligible for
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* @module getTitle
|
||||
* @module title
|
||||
*/
|
||||
|
||||
var mw = window.mediaWiki;
|
||||
|
@ -44,4 +44,6 @@ function getTitle( href, config ) {
|
|||
return undefined;
|
||||
}
|
||||
|
||||
module.exports = getTitle;
|
||||
module.exports = {
|
||||
getTitle: getTitle
|
||||
};
|
|
@ -6,7 +6,7 @@ var mock = require( 'mock-require' ),
|
|||
QUnit.module( 'ext.popups/processLinks', {
|
||||
beforeEach: function () {
|
||||
this.getTitle = this.sandbox.stub().throws( 'UNIMPLEMENTED' );
|
||||
mock( '../../src/getTitle', this.getTitle );
|
||||
mock( '../../src/title', { getTitle: this.getTitle } );
|
||||
processLinks = mock.reRequire( '../../src/processLinks' );
|
||||
|
||||
this.$container = $( '<div />' );
|
||||
|
@ -21,7 +21,7 @@ QUnit.module( 'ext.popups/processLinks', {
|
|||
};
|
||||
},
|
||||
afterEach: function () {
|
||||
mock.stop( '../../src/getTitle' );
|
||||
mock.stop( '../../src/title' );
|
||||
window.mediaWiki.Title = null;
|
||||
}
|
||||
} );
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
var getTitle = require( '../../src/getTitle' );
|
||||
var getTitle = require( '../../src/title' ).getTitle;
|
||||
|
||||
/* global Map */
|
||||
|
||||
QUnit.module( 'getTitle', {
|
||||
QUnit.module( 'title#getTitle', {
|
||||
beforeEach: function () {
|
||||
this.config = new Map();
|
||||
this.config.set( 'wgArticlePath', '/wiki/$1' );
|
Loading…
Reference in a new issue