mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-12 01:08:39 +00:00
model: extract -> page
In I6bbff6a5 a preview was assigned the "extract" type if it had an extract whereas it should've been assigned the "page" type. Bug: T152004 Change-Id: I5e0cdc8f528647f1e20873753be29c6b85b3a384
This commit is contained in:
parent
8c96564915
commit
ab75283392
|
@ -1,7 +1,7 @@
|
||||||
( function ( mw ) {
|
( function ( mw ) {
|
||||||
|
|
||||||
var TYPE_GENERIC = 'generic',
|
var TYPE_GENERIC = 'generic',
|
||||||
TYPE_EXTRACT = 'extract';
|
TYPE_PAGE = 'page';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} ext.popups.PreviewModel
|
* @typedef {Object} ext.popups.PreviewModel
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
/**
|
/**
|
||||||
* @constant {String}
|
* @constant {String}
|
||||||
*/
|
*/
|
||||||
mw.popups.preview.TYPE_EXTRACT = TYPE_EXTRACT;
|
mw.popups.preview.TYPE_PAGE = TYPE_PAGE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a preview model.
|
* Creates a preview model.
|
||||||
|
@ -52,7 +52,7 @@
|
||||||
languageCode: languageCode,
|
languageCode: languageCode,
|
||||||
languageDirection: languageDirection,
|
languageDirection: languageDirection,
|
||||||
extract: processedExtract,
|
extract: processedExtract,
|
||||||
type: processedExtract === undefined ? TYPE_GENERIC : TYPE_EXTRACT,
|
type: processedExtract === undefined ? TYPE_GENERIC : TYPE_PAGE,
|
||||||
thumbnail: thumbnail
|
thumbnail: thumbnail
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -62,8 +62,8 @@
|
||||||
|
|
||||||
assert.strictEqual(
|
assert.strictEqual(
|
||||||
model.type,
|
model.type,
|
||||||
mw.popups.preview.TYPE_EXTRACT,
|
mw.popups.preview.TYPE_PAGE,
|
||||||
'A non-generic ("extract") preview has an extract.'
|
'A non-generic ("page") preview has an extract.'
|
||||||
);
|
);
|
||||||
|
|
||||||
model = createModelWithExtract( '' );
|
model = createModelWithExtract( '' );
|
||||||
|
|
Loading…
Reference in a new issue