From dd8e2894e58eb2fd5cee1c20b3e773d724b659fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Knapik?= Date: Wed, 2 Oct 2019 22:54:23 +0200 Subject: [PATCH] Math.ceil the height value passed to setDeviceMetricsOverride (#174) * Math.ceil the height passed to setDeviceMetricsOverride * Add a test case for non-integer viewport Add reference images for Non-Integer Viewport * Fix loki logo URL in visual tests (#175) --- .../chrome_a4_Non_Int_Viewport_default.png | Bin 0 -> 8794 bytes .../chrome_iphone7_Non_Int_Viewport_default.png | Bin 0 -> 18609 bytes .../chrome_laptop_Non_Int_Viewport_default.png | Bin 0 -> 13234 bytes examples/react/src/NonIntViewport.js | 14 ++++++++++++++ examples/react/src/stories/index.js | 8 ++++++++ src/targets/chrome/create-chrome-target.js | 2 +- 6 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 examples/react/.loki/reference/chrome_a4_Non_Int_Viewport_default.png create mode 100644 examples/react/.loki/reference/chrome_iphone7_Non_Int_Viewport_default.png create mode 100644 examples/react/.loki/reference/chrome_laptop_Non_Int_Viewport_default.png create mode 100644 examples/react/src/NonIntViewport.js diff --git a/examples/react/.loki/reference/chrome_a4_Non_Int_Viewport_default.png b/examples/react/.loki/reference/chrome_a4_Non_Int_Viewport_default.png new file mode 100644 index 0000000000000000000000000000000000000000..620281e261cc6fe989ebb37f3235810a581adb14 GIT binary patch literal 8794 zcmeI2{a4c2zQ>tqPBk-SGt)Flnoc9?X-pX@!>3?6HY$bM^OFx$qF6qlq9Q6%Q)Z2% z1u3Eem6OhNO43q7P^L_rZ-|tPqN$jP5TTNwBBF4eyYBtz{sDKLwft?bz4qE`@BMkd z)?S~_`*U@Fc*xq%Hhl&Hf!3lz_Z$R)J`MtbK8aqva%twEPw-w4=vxqK&+fz7RTD$G z)4vjT4^PR|`RgDBU+}*!8ibx%Q63r_`qPC?V<|s=^=|8t&uS0;up!CgxZQO2irvNS z7vbAhk7RxI_06J+Q@7TB^2zt#eE8Yvj~!dS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8< zYXN^QWIsM7XBuqy?sw`oMm%V~ftuGOXEv&~&q&6)j~=qUYhz0c#bVsV1V312xbL6} zWUBi#nYZC>g=R{zGGoj@K?JkZx5c;|v2%u*i?Fq-5w0~hndY(W3^nfrXDO2+Eo7>z z-GS=??GBQxASOGS_^%>{<(a-l|BK@r-(XaA;wJT@Q*wd(ka@xJy`{y(cYkes$wIVr zFD_jVRY^t+^^Qs{;xgdRtJ>cyyMGe1sqf~f`CM9yY}|n#p^&$5qtP>~#kd0$^D!UQ zw_@DiB)NyoP=#Q#)mO!1EcNM7RY2B&HPOs|iEV^vAH^?;4l*VZ8HEEsH$Oo*qfc-O zdVlUK;C zDB_P8UXB+~w+yWUw6i}{t&R9lx`Q!`|NHNewdo>!)=qtE!mZVSyn{Or3@@4x?A&Jq z_`bH5&K{apnk;l=L&e8io<=+WoKAUnE)rp;Y>C(Y;us`UInAKarYM-^jf3W0#~MI$ z|4AR))3yZPaRoaMy-_6_8Q1;PFn5)S9E?{)8<|BJB0PSX+z{bo1^cVv?|T392Yl`X zjZ&Mr=29c{k2Rq|&>|r+qX-VcA6y4jIgWjjCqmZC7;2;as>jiz_nn2%rce)Wz+0T61kBLgIB&ow6@|W*a;wpuaQo6l zY{E0LI4?&$;BJuR>K53JwMe8ml6QXfs!POA<2wpbXnnt0{SMU!8LR79CK5#k10sRd zBUL6yFHCV}PoM0gR=MA(i{C0@PGw1~HlW3d8B8R)kh!cqq2!i)9Ei zxegh0LG0gVc{v=h0r2+Y{ljnnBY~mjx3QANZs_(cmKSYj5$4N|8Xvqu1X~NpyqBH^ rX_=UkTo93^7yz<`wIGtGQ literal 0 HcmV?d00001 diff --git a/examples/react/.loki/reference/chrome_laptop_Non_Int_Viewport_default.png b/examples/react/.loki/reference/chrome_laptop_Non_Int_Viewport_default.png new file mode 100644 index 0000000000000000000000000000000000000000..e61798f7308897e8391a54f1e4ab7d622fa11fba GIT binary patch literal 13234 zcmeHO`&&|3zjtQp)iYf@&ZT55t;A?1(@{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al 0 HcmV?d00001 diff --git a/examples/react/src/NonIntViewport.js b/examples/react/src/NonIntViewport.js new file mode 100644 index 00000000..cb868f6c --- /dev/null +++ b/examples/react/src/NonIntViewport.js @@ -0,0 +1,14 @@ +import React from 'react'; +import PropTypes from 'prop-types'; + +const NonIntViewport = ({ children }) => ( +
+ { children } +
+); + +export default NonIntViewport; diff --git a/examples/react/src/stories/index.js b/examples/react/src/stories/index.js index 44a7a9e4..98d0d7c8 100644 --- a/examples/react/src/stories/index.js +++ b/examples/react/src/stories/index.js @@ -12,6 +12,7 @@ import MediaAwareComponent from '../MediaAwareComponent'; import StackedElements from '../StackedElements'; import StackedInvisibleElements from '../StackedInvisibleElements'; import LongElement from '../LongElement'; +import NonIntViewport from '../NonIntViewport'; storiesOf('Welcome', module).lokiSkip('to Storybook', () => ( @@ -53,3 +54,10 @@ storiesOf('Multiple elements', module) .add('Invisible elements', () => ); storiesOf('Long Element', module).add('default', () => ); + +storiesOf('Non-Int Viewport', module) + .add('default', () => ( + + + +)); diff --git a/src/targets/chrome/create-chrome-target.js b/src/targets/chrome/create-chrome-target.js index 5b4b4842..a833ae2c 100644 --- a/src/targets/chrome/create-chrome-target.js +++ b/src/targets/chrome/create-chrome-target.js @@ -192,7 +192,7 @@ function createChromeTarget( resetDeviceMetrics = true; await Emulation.setDeviceMetricsOverride( Object.assign({}, deviceMetrics, { - height: position.y + position.height, + height: Math.ceil(position.y + position.height), }) ); }