mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-23 23:24:39 +00:00
Use faster implicit conversion instead of Number.parseFloat
Change-Id: Ide478617475c73bfe6a81cdb171d606082a1448b
This commit is contained in:
parent
59dbc59a81
commit
050911fe11
|
@ -71,32 +71,32 @@ QUnit.test( 'createThumbnail - tall image element', ( assert ) => {
|
|||
} );
|
||||
|
||||
assert.strictEqual(
|
||||
Number.parseFloat( thumbnail.el.find( 'image' ).attr( 'x' ) ),
|
||||
+thumbnail.el.find( 'image' ).attr( 'x' ),
|
||||
case_.expectedX,
|
||||
`Image element x coordinate is correct. ${case_.message}`
|
||||
);
|
||||
assert.strictEqual(
|
||||
Number.parseFloat( thumbnail.el.find( 'image' ).attr( 'y' ) ),
|
||||
+thumbnail.el.find( 'image' ).attr( 'y' ),
|
||||
case_.expectedY,
|
||||
`Image element y coordinate is correct. ${case_.message}`
|
||||
);
|
||||
assert.strictEqual(
|
||||
Number.parseFloat( thumbnail.el.find( 'image' ).attr( 'width' ) ),
|
||||
+thumbnail.el.find( 'image' ).attr( 'width' ),
|
||||
case_.width,
|
||||
`Image element width is correct. ${case_.message}`
|
||||
);
|
||||
assert.strictEqual(
|
||||
Number.parseFloat( thumbnail.el.find( 'image' ).attr( 'height' ) ),
|
||||
+thumbnail.el.find( 'image' ).attr( 'height' ),
|
||||
case_.height,
|
||||
`Image element height is correct. ${case_.message}`
|
||||
);
|
||||
assert.strictEqual(
|
||||
Number.parseFloat( thumbnail.el.attr( 'width' ) ),
|
||||
+thumbnail.el.attr( 'width' ),
|
||||
case_.expectedSVGWidth,
|
||||
`Image SVG width is correct. ${case_.message}`
|
||||
);
|
||||
assert.strictEqual(
|
||||
Number.parseFloat( thumbnail.el.attr( 'height' ) ),
|
||||
+thumbnail.el.attr( 'height' ),
|
||||
case_.expectedSVGHeight,
|
||||
`Image SVG height is correct. ${case_.message}`
|
||||
);
|
||||
|
@ -169,32 +169,32 @@ QUnit.test( 'createThumbnail - landscape image element', ( assert ) => {
|
|||
} );
|
||||
|
||||
assert.strictEqual(
|
||||
Number.parseFloat( thumbnail.el.find( 'image' ).attr( 'x' ) ),
|
||||
+thumbnail.el.find( 'image' ).attr( 'x' ),
|
||||
case_.expectedX,
|
||||
`Image x coordinate is correct. ${case_.message}`
|
||||
);
|
||||
assert.strictEqual(
|
||||
Number.parseFloat( thumbnail.el.find( 'image' ).attr( 'y' ) ),
|
||||
+thumbnail.el.find( 'image' ).attr( 'y' ),
|
||||
case_.expectedY,
|
||||
`Image y coordinate is correct. ${case_.message}`
|
||||
);
|
||||
assert.strictEqual(
|
||||
Number.parseFloat( thumbnail.el.find( 'image' ).attr( 'width' ) ),
|
||||
+thumbnail.el.find( 'image' ).attr( 'width' ),
|
||||
case_.width,
|
||||
`Image element width is correct. ${case_.message}`
|
||||
);
|
||||
assert.strictEqual(
|
||||
Number.parseFloat( thumbnail.el.find( 'image' ).attr( 'height' ) ),
|
||||
+thumbnail.el.find( 'image' ).attr( 'height' ),
|
||||
case_.height,
|
||||
`Image element height is correct. ${case_.message}`
|
||||
);
|
||||
assert.strictEqual(
|
||||
Number.parseFloat( thumbnail.el.attr( 'width' ) ),
|
||||
+thumbnail.el.attr( 'width' ),
|
||||
case_.expectedSVGWidth,
|
||||
`Image SVG width is correct. ${case_.message}`
|
||||
);
|
||||
assert.strictEqual(
|
||||
Number.parseFloat( thumbnail.el.attr( 'height' ) ),
|
||||
+thumbnail.el.attr( 'height' ),
|
||||
case_.expectedSVGHeight,
|
||||
`Image SVG height is correct. ${case_.message}`
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue