Remove not needed boilerplate from QUnit tests

These tests obviously don't need this extra environment.
They run just fine (and faster) without.

Bug: T289560
Change-Id: Ib186a07cd556f741e0440ffa54ae6aaaf626adcd
This commit is contained in:
Thiemo Kreuz 2021-08-25 10:31:34 +02:00 committed by Thiemo Kreuz (WMDE)
parent 46bccb570a
commit a0e613d8fc
7 changed files with 25 additions and 27 deletions

View file

@ -5,7 +5,7 @@
* @license The MIT License (MIT); see LICENSE.txt
*/
QUnit.module( 've.ce.ContentBranchNode (MW)', ve.test.utils.mwEnvironment );
QUnit.module( 've.ce.ContentBranchNode (MW)' );
/* Tests */

View file

@ -1,6 +1,6 @@
( function () {
QUnit.module( 've.dm.MWTemplateSpecModel', ve.test.utils.mwEnvironment );
QUnit.module( 've.dm.MWTemplateSpecModel' );
/**
* @param {string[]} [parameterNames]

View file

@ -5,7 +5,7 @@
* @license The MIT License (MIT); see LICENSE.txt
*/
QUnit.module( 've.dm.MWTransclusionNode', ve.test.utils.mwEnvironment );
QUnit.module( 've.dm.MWTransclusionNode' );
/* Tests */

View file

@ -5,7 +5,7 @@
* @license The MIT License (MIT); see LICENSE.txt
*/
QUnit.module( 've.dm.Document (MW)', ve.test.utils.mwEnvironment );
QUnit.module( 've.dm.Document (MW)' );
/* Tests */

View file

@ -5,7 +5,7 @@
* @license The MIT License (MIT); see LICENSE.txt
*/
QUnit.module( 've.dm.MWImageModel', ve.test.utils.mwEnvironment );
QUnit.module( 've.dm.MWImageModel' );
/* Tests */

View file

@ -19,7 +19,7 @@
}
};
QUnit.module( 've.dm.MWTemplateModel', ve.test.utils.mwEnvironment );
QUnit.module( 've.dm.MWTemplateModel' );
/**
* Create a new MWTemplateModel initialized with a static transclusion data fixture.

View file

@ -1,27 +1,25 @@
( function () {
QUnit.module( 've.ui.MWTransclusionOutlineParameterWidget', ve.test.utils.mwEnvironment );
QUnit.module( 've.ui.MWTransclusionOutlineParameterWidget' );
QUnit.test( 'interprets param with no attributes', ( assert ) => {
const layout = new ve.ui.MWTransclusionOutlineParameterWidget( {} );
QUnit.test( 'interprets param with no attributes', ( assert ) => {
const layout = new ve.ui.MWTransclusionOutlineParameterWidget( {} );
assert.strictEqual( layout.checkbox.isDisabled(), false );
assert.strictEqual( layout.checkbox.isSelected(), false );
assert.strictEqual( layout.checkbox.getTitle(), null );
} );
assert.strictEqual( layout.checkbox.isDisabled(), false );
assert.strictEqual( layout.checkbox.isSelected(), false );
assert.strictEqual( layout.checkbox.getTitle(), null );
} );
QUnit.test( 'interprets required param', ( assert ) => {
const layout = new ve.ui.MWTransclusionOutlineParameterWidget( { required: true } );
QUnit.test( 'interprets required param', ( assert ) => {
const layout = new ve.ui.MWTransclusionOutlineParameterWidget( { required: true } );
assert.strictEqual( layout.checkbox.isDisabled(), true );
assert.strictEqual( layout.checkbox.isSelected(), true );
assert.notStrictEqual( layout.checkbox.getTitle(), null );
} );
assert.strictEqual( layout.checkbox.isDisabled(), true );
assert.strictEqual( layout.checkbox.isSelected(), true );
assert.notStrictEqual( layout.checkbox.getTitle(), null );
} );
QUnit.test( 'interprets selected param', ( assert ) => {
const layout = new ve.ui.MWTransclusionOutlineParameterWidget( { selected: true } );
QUnit.test( 'interprets selected param', ( assert ) => {
const layout = new ve.ui.MWTransclusionOutlineParameterWidget( { selected: true } );
assert.strictEqual( layout.checkbox.isDisabled(), false );
assert.strictEqual( layout.checkbox.isSelected(), true );
assert.strictEqual( layout.checkbox.getTitle(), null );
} );
}() );
assert.strictEqual( layout.checkbox.isDisabled(), false );
assert.strictEqual( layout.checkbox.isSelected(), true );
assert.strictEqual( layout.checkbox.getTitle(), null );
} );