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:
joakin 2017-06-08 12:08:58 +02:00
parent b0b10fff92
commit ef2f99ef65
6 changed files with 9 additions and 7 deletions

Binary file not shown.

Binary file not shown.

View file

@ -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

View file

@ -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
};

View file

@ -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;
}
} );

View file

@ -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' );