Skip to content

Commit

Permalink
test: apply code suggestions from @styfle's review
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed Apr 4, 2022
1 parent f3443bd commit 091842a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Expand Up @@ -8,10 +8,7 @@ const Page = () => {
<p>Home Page</p>
<div id="spacer" style={{ height: '150vh' }} />
<Image id="basic-image" src={src} width="400" height="400"></Image>
<button
id="button-change-image-src"
onClick={() => setSrc('/test.jpg?new')}
>
<button id="button-change-image-src" onClick={() => setSrc('/test.png')}>
Change Image
</button>
</div>
Expand Down
10 changes: 10 additions & 0 deletions test/integration/image-component/default/test/index.test.js
Expand Up @@ -1209,6 +1209,11 @@ function runTests(mode) {
return 'result-correct'
}, /result-correct/)

await check(
() => browser.eval(`document.getElementById("basic-image").currentSrc`),
/test\.jpg/
)

// Make image out of viewport again
await browser.eval(
'document.getElementById("spacer").style.display = "block"'
Expand Down Expand Up @@ -1247,6 +1252,11 @@ function runTests(mode) {

return 'result-correct'
}, /result-correct/)

await check(
() => browser.eval(`document.getElementById("basic-image").currentSrc`),
/test\.png/
)
} finally {
if (browser) {
await browser.close()
Expand Down

0 comments on commit 091842a

Please sign in to comment.