mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-23 15:16:50 +00:00
QA: Test renderer#hide
Bug: T133022 Change-Id: I752c4266b6be1909a3265d8292e7c5229e5724fb
This commit is contained in:
parent
76d323da60
commit
d95badc614
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.
|
@ -692,6 +692,7 @@ module.exports = {
|
|||
createPokeyMasks: createPokeyMasks,
|
||||
createPreview: createPreview,
|
||||
createEmptyPreview: createEmptyPreview,
|
||||
hide: hide,
|
||||
createThumbnail: createThumbnail,
|
||||
createThumbnailElement: createThumbnailElement,
|
||||
renderExtract: renderExtract,
|
||||
|
|
|
@ -145,6 +145,74 @@ QUnit.test( 'createEmptyPreview', function ( assert ) {
|
|||
);
|
||||
} );
|
||||
|
||||
QUnit.test( 'hide - fade out up', function ( assert ) {
|
||||
var preview = {
|
||||
el: $( '<div>', { 'class': 'mwe-popups-fade-in-down' } ),
|
||||
hasThumbnail: false,
|
||||
thumbnail: null,
|
||||
isTall: false
|
||||
},
|
||||
done = assert.async( 1 ),
|
||||
$container = $( '<div>' ).append( preview.el ),
|
||||
promise = renderer.hide( preview );
|
||||
|
||||
assert.ok(
|
||||
preview.el.hasClass( 'mwe-popups-fade-out-up' ),
|
||||
'Thumbnail has faded out up.'
|
||||
);
|
||||
assert.notOk(
|
||||
preview.el.hasClass( 'mwe-popups-fade-in-down' ),
|
||||
'Fade-in class has been removed.'
|
||||
);
|
||||
assert.notEqual(
|
||||
$container.html(),
|
||||
'',
|
||||
'Preview is still in the container.'
|
||||
);
|
||||
promise.done( function () {
|
||||
assert.equal(
|
||||
$container.html(),
|
||||
'',
|
||||
'Preview has been removed from the container.'
|
||||
);
|
||||
done();
|
||||
} );
|
||||
} );
|
||||
|
||||
QUnit.test( 'hide - fade out down', function ( assert ) {
|
||||
var preview = {
|
||||
el: $( '<div>', { 'class': 'mwe-popups-fade-in-up' } ),
|
||||
hasThumbnail: false,
|
||||
thumbnail: null,
|
||||
isTall: false
|
||||
},
|
||||
done = assert.async( 1 ),
|
||||
$container = $( '<div>' ).append( preview.el ),
|
||||
promise = renderer.hide( preview );
|
||||
|
||||
assert.ok(
|
||||
preview.el.hasClass( 'mwe-popups-fade-out-down' ),
|
||||
'Thumbnail has faded out down.'
|
||||
);
|
||||
assert.notOk(
|
||||
preview.el.hasClass( 'mwe-popups-fade-in-up' ),
|
||||
'Fade-in class has been removed.'
|
||||
);
|
||||
assert.notEqual(
|
||||
$container.html(),
|
||||
'',
|
||||
'Preview is still in the container.'
|
||||
);
|
||||
promise.done( function () {
|
||||
assert.equal(
|
||||
$container.html(),
|
||||
'',
|
||||
'Preview has been removed from the container.'
|
||||
);
|
||||
done();
|
||||
} );
|
||||
} );
|
||||
|
||||
QUnit.test( 'createThumbnail - tall image', function ( assert ) {
|
||||
var devicePixelRatio = $.bracketedDevicePixelRatio(),
|
||||
rawThumbnail = {
|
||||
|
|
Loading…
Reference in a new issue