Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(gatsby-plugin-image): add test for gatsby-plugin-image browser #28101

Merged
merged 4 commits into from
Nov 16, 2020
Merged

test(gatsby-plugin-image): add test for gatsby-plugin-image browser #28101

merged 4 commits into from
Nov 16, 2020

Conversation

mfrachet
Copy link
Contributor

@mfrachet mfrachet commented Nov 16, 2020

Description

Added some tests for gatsby-image.browser

Screenshot 2020-11-16 at 15 59 44

I did what I had in mind, this was quite tough to tests 馃槄

Feel free to ask for more, I'm maybe missing some cases 馃槵

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Nov 16, 2020
@mfrachet mfrachet added topic: media Related to gatsby-plugin-image, or general image/media processing topics and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Nov 16, 2020
@mfrachet mfrachet marked this pull request as ready for review November 16, 2020 15:35
@mfrachet mfrachet requested review from a team and wardpeet November 16, 2020 16:01
Copy link
Contributor

@gillkyle gillkyle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since me and @mfrachet pulled up this code together and walked through the logic in gatsby-image.browser.tsx and these tests side by side I'm inclined to say this looks good! I learned a thing or two about some testing utilities along the way too 馃檪

}

beforeHydrationContent = document.createElement(`div`)
beforeHydrationContent.innerHTML = `
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woah, is this to replicate the SSR? Clever.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

Copy link
Contributor

@ascorbic ascorbic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome. Great work, @mfrachet ! I've not tested hydration before. Really interesting to see how it's done, and I feel a lot more confident with this in.

@mfrachet
Copy link
Contributor Author

Happy it increases confidence! Thanks for the kind words 馃槉

@mfrachet mfrachet merged commit fa19ba2 into gatsbyjs:master Nov 16, 2020
@mfrachet mfrachet deleted the add-testing-for-gatsby-plugin-image-browser branch November 16, 2020 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: media Related to gatsby-plugin-image, or general image/media processing topics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants