2014-03-17 08:07:53 +00:00
|
|
|
/*
|
|
|
|
* This file is part of the MediaWiki extension MultimediaViewer.
|
|
|
|
*
|
|
|
|
* MultimediaViewer is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* MultimediaViewer is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with MultimediaViewer. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2023-05-20 08:30:52 +00:00
|
|
|
const { Tab } = require( 'mmv.ui.reuse.shareembed' );
|
|
|
|
|
2018-11-12 16:33:24 +00:00
|
|
|
( function () {
|
2014-03-17 08:07:53 +00:00
|
|
|
var $fixture = $( '#qunit-fixture' );
|
|
|
|
|
|
|
|
function makeReuseTab() {
|
2023-05-20 08:30:52 +00:00
|
|
|
return new Tab( $( '<div>' ).appendTo( $fixture ), $fixture );
|
2014-03-17 08:07:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QUnit.module( 'mmv.ui.reuse.Tab', QUnit.newMwEnvironment() );
|
|
|
|
|
2017-07-25 23:38:21 +00:00
|
|
|
QUnit.test( 'Object creation, UI construction and basic funtionality', function ( assert ) {
|
2014-03-17 08:07:53 +00:00
|
|
|
var reuseTab = makeReuseTab();
|
|
|
|
|
2023-05-20 08:30:52 +00:00
|
|
|
assert.true( reuseTab instanceof Tab, 'Reuse UI element is created.' );
|
2014-03-17 08:07:53 +00:00
|
|
|
assert.strictEqual( reuseTab.$pane.length, 1, 'Pane created.' );
|
|
|
|
|
2018-06-06 18:23:25 +00:00
|
|
|
assert.strictEqual( reuseTab.$pane.hasClass( 'active' ), false, 'Tab is not active.' );
|
2014-03-17 08:07:53 +00:00
|
|
|
|
|
|
|
reuseTab.show();
|
|
|
|
|
2018-06-06 18:23:25 +00:00
|
|
|
assert.strictEqual( reuseTab.$pane.hasClass( 'active' ), true, 'Tab is active.' );
|
2014-03-17 08:07:53 +00:00
|
|
|
|
|
|
|
reuseTab.hide();
|
|
|
|
|
2018-06-06 18:23:25 +00:00
|
|
|
assert.strictEqual( reuseTab.$pane.hasClass( 'active' ), false, 'Tab is not active.' );
|
2014-03-17 08:07:53 +00:00
|
|
|
} );
|
2018-11-12 16:33:24 +00:00
|
|
|
}() );
|