Last active
April 25, 2022 17:45
-
-
Save dschinkel/7d16a0ffb551ab2fb6221b9767d26628 to your computer and use it in GitHub Desktop.
Example Integration Test using isolate-react library
This file contains hidden or 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
//https://www.npmjs.com/package/isolate-react | |
it.only('shows count of all crafters', async () => { | |
const crafters = [{ ...crafterProfileData }, { ...crafterProfileData }]; | |
const foundCrafters: Crafters = { | |
list: crafters, | |
aggregates: { | |
count: crafters.length, | |
}, | |
}; | |
const findCrafters = async () => foundCrafters; | |
const featuredCrafters = isolateComponent(<FeaturedCrafters findCrafters={findCrafters} httpRequest={HttpRequest} />); | |
await Promise.resolve(); | |
featuredCrafters.inline(CrafterHeader); | |
featuredCrafters.inline(ShowAllCraftersLink); | |
const crafterCount = featuredCrafters.findOne('[data-test-id=crafter-count]'); | |
expect(parseInt(crafterCount.content())).to.equal(foundCrafters.list.length); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment