mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2025-01-09 20:24:17 +00:00
Merge "[qunit] Use strict and wrap test scope"
This commit is contained in:
commit
20ede4b0f4
|
@ -1,3 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
( function () {
|
||||
function createStubTitle( fragment = null ) {
|
||||
return {
|
||||
getFragment() {
|
||||
|
@ -150,7 +153,11 @@ QUnit.test( 'Reference preview gateway rejects non-existing references', functio
|
|||
return gateway.fetchPreviewForTitle( title, this.$sourceElement[ 0 ] ).then( () => {
|
||||
assert.true( false, 'It should not resolve' );
|
||||
} ).catch( ( result ) => {
|
||||
assert.propEqual( result, { textStatus: 'abort', textContext: 'Footnote not found or empty', xhr: { readyState: 0 } } );
|
||||
assert.propEqual( result, {
|
||||
textStatus: 'abort',
|
||||
textContext: 'Footnote not found or empty',
|
||||
xhr: { readyState: 0 }
|
||||
} );
|
||||
} );
|
||||
} );
|
||||
|
||||
|
@ -161,7 +168,11 @@ QUnit.test( 'Reference preview gateway rejects all-whitespace references', funct
|
|||
return gateway.fetchPreviewForTitle( title, this.$sourceElement[ 0 ] ).then( () => {
|
||||
assert.true( false, 'It should not resolve' );
|
||||
} ).catch( ( result ) => {
|
||||
assert.propEqual( result, { textStatus: 'abort', textContext: 'Footnote not found or empty', xhr: { readyState: 0 } } );
|
||||
assert.propEqual( result, {
|
||||
textStatus: 'abort',
|
||||
textContext: 'Footnote not found or empty',
|
||||
xhr: { readyState: 0 }
|
||||
} );
|
||||
} );
|
||||
} );
|
||||
|
||||
|
@ -172,3 +183,4 @@ QUnit.test( 'Reference preview gateway is abortable', function ( assert ) {
|
|||
|
||||
assert.strictEqual( typeof promise.abort, 'function' );
|
||||
} );
|
||||
}() );
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
( function () {
|
||||
function createStubUserSettings( expectEnabled ) {
|
||||
return {
|
||||
isPreviewTypeEnabled() {
|
||||
|
@ -52,7 +55,8 @@ QUnit.test( 'relevant combinations of anonymous flags', ( assert ) => {
|
|||
isNamed: () => !data.isAnon && !data.isIPMasked,
|
||||
isAnon: () => data.isAnon,
|
||||
options: {
|
||||
get: () => {}
|
||||
get: () => {
|
||||
}
|
||||
}
|
||||
},
|
||||
isPreviewTypeEnabled = () => {
|
||||
|
@ -104,3 +108,4 @@ QUnit.test( 'it should not be enabled when the global is disabling it', ( assert
|
|||
'Reference Previews is disabled.'
|
||||
);
|
||||
} );
|
||||
}() );
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
( function () {
|
||||
let createReferencePreview;
|
||||
const previewTypes = { TYPE_REFERENCE: 'reference' };
|
||||
|
||||
|
@ -90,3 +93,4 @@ QUnit.test( 'createReferencePreview collapsible/sortable handling', ( assert ) =
|
|||
'<cite-reference-previews-collapsible-placeholder>'
|
||||
);
|
||||
} );
|
||||
}() );
|
||||
|
|
Loading…
Reference in a new issue