From 050911fe11704fb7f50579c54b682f7e648097f1 Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Tue, 3 Mar 2020 15:16:51 +0000 Subject: [PATCH] Use faster implicit conversion instead of Number.parseFloat Change-Id: Ide478617475c73bfe6a81cdb171d606082a1448b --- tests/node-qunit/ui/thumbnail.test.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/node-qunit/ui/thumbnail.test.js b/tests/node-qunit/ui/thumbnail.test.js index 3600020d5..d844cc2e3 100644 --- a/tests/node-qunit/ui/thumbnail.test.js +++ b/tests/node-qunit/ui/thumbnail.test.js @@ -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}` );