Last active
August 14, 2018 17:07
-
-
Save inakianduaga/0e33c8c3a668951750de0c53524756ab to your computer and use it in GitHub Desktop.
Redux for vanillaJS Medium.com article - Dom test example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "jest"; | |
describe("DOM image manipulation", () => { | |
test("applies class to image on applyFilterToImage", () => { | |
document.body.innerHTML = ` | |
<div id="some-dom-id"> | |
<div class="image-wrapper"> | |
<img class="image selected" src="testImage"> | |
<img class="image" src="testImage2"> | |
<img class="image" src="testImage3"> | |
<img class="image" src="testImage4"> | |
<img class="image" src="testImage5"> | |
</div> | |
</div> | |
`; | |
dom.applyFiltersToImages([{ index: 1, filter: "greyscale" }]); | |
expect(document.body.innerHTML).toMatchSnapshot(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment