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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added e2e tests for page.tag.detached webhook #15651

Merged
merged 4 commits into from
Oct 30, 2022

Conversation

Dark-Knight11
Copy link
Contributor

refs: #15537

This adds an e2e test and test snapshot for the page.tag.detached webhook so we can prevent regressions and bugs in the future

Got some code for us? Awesome 🎊!

Please include a description of your change & check your PR against this list, thanks!

  • There's a clear use-case for this code change, explained below
  • Commit message has a short title & references relevant issues
  • The build will pass (run yarn test:all and yarn lint)

We appreciate your contribution!

Also, if you'd be interested in writing code like this for us more regularly, we're hiring:
https://careers.ghost.org

@naz naz self-assigned this Oct 19, 2022
@@ -56,13 +68,47 @@ const buildPageSnapshotWithTiers = ({
};
};

const buildPageSnapshotWithTiersAndTags = ({
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to reuse the buildPageSnapshotWithTiers method here?

@codecov
Copy link

codecov bot commented Oct 19, 2022

Codecov Report

Base: 53.41% // Head: 53.41% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (d57cc8d) compared to base (096dffb).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #15651   +/-   ##
=======================================
  Coverage   53.41%   53.41%           
=======================================
  Files        1502     1502           
  Lines       97876    97876           
  Branches    10961    10962    +1     
=======================================
+ Hits        52277    52282    +5     
+ Misses      44342    44338    -4     
+ Partials     1257     1256    -1     
Impacted Files Coverage Δ
ghost/admin/app/helpers/gh-price-amount.js 44.44% <0.00%> (-22.23%) ⬇️
ghost/admin/app/components/gh-image-uploader.js 87.07% <0.00%> (+2.72%) ⬆️
ghost/admin/app/components/gh-site-iframe.js 52.27% <0.00%> (+6.81%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

const tagSnapshot = {
created_at: anyISODateTime,
id: anyObjectId,
name: anyString,
Copy link
Contributor

Choose a reason for hiding this comment

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

The tag's name, slug, visibility etc. are not changing between test runs? If they are not, would be best to have snapshot capture them as is - no need to include non-dynamic properties in the snapshot matcher object 👍

Copy link
Contributor

@naz naz left a comment

Choose a reason for hiding this comment

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

Hey-hey @Dark-Knight11 👋 These are great changes are I think we are 90% there. I've left couple of comments around areas that need improvement. Feel free to reach out if you need more guidance and thanks for the contribution!

@github-actions
Copy link
Contributor

Note from our bot: Some changes have been requested on this pull request. Updating your code is great, but won't notify us, so please leave a comment so that we (and our bot) can see when you've made the changes. Thank you 🙏

@naz naz mentioned this pull request Oct 19, 2022
29 tasks
@Dark-Knight11
Copy link
Contributor Author

Hey-hey @Dark-Knight11 👋 These are great changes are I think we are 90% there. I've left couple of comments around areas that need improvement. Feel free to reach out if you need more guidance and thanks for the contribution!

Hi, I have made the requested changes kindly look into it and lmk if anymore changes are needed from my side.
Thanks!

@naz
Copy link
Contributor

naz commented Oct 20, 2022

The snapshots seem to be outdated on and are failing now. Can you please re-record them again @Dark-Knight11 🙏

@Dark-Knight11 Dark-Knight11 force-pushed the page-tag-detached branch 2 times, most recently from d696f78 to 8a3c40c Compare October 20, 2022 10:39
@Dark-Knight11 Dark-Knight11 reopened this Oct 21, 2022
Copy link
Contributor

@naz naz left a comment

Choose a reason for hiding this comment

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

Great work on these changes @Dark-Knight11! Looking forward for more contributions 😊

@ErisDS ErisDS force-pushed the page-tag-detached branch 2 times, most recently from bb5375e to 09d89e2 Compare October 24, 2022 19:10
@Dark-Knight11 Dark-Knight11 force-pushed the page-tag-detached branch 3 times, most recently from 9b7446f to 73ec31a Compare October 26, 2022 14:40
@ErisDS ErisDS force-pushed the page-tag-detached branch from b4b78a6 to fd25388 Compare October 30, 2022 13:47
Dark-Knight11 and others added 4 commits October 30, 2022 14:17
ref TryGhost#15537

- this adds an e2e test and test snapshot for the page.published webhook
so we can prevent regressions and bugs in the future
refs: TryGhost#15537

This adds an e2e test and test snapshot for the page.tag.detached webhook
so we can prevent regressions and bugs in the future
@ErisDS ErisDS force-pushed the page-tag-detached branch from fd25388 to d57cc8d Compare October 30, 2022 14:17
@ErisDS ErisDS changed the title Added e2e test for page.tag.detached event Added e2e tests for page.tag.detached webhook Oct 30, 2022
@ErisDS ErisDS merged commit 3f289ed into TryGhost:main Oct 30, 2022
@ErisDS
Copy link
Member

ErisDS commented Oct 30, 2022

Hey @Dark-Knight11 thanks again for your contributions! This has been merged and the hacktoberfest-accepted label added to make sure it counts.

Please keep them coming 🙏 we have so much we want to achieve beyond hacktoberfest 😬

@Dark-Knight11 Dark-Knight11 deleted the page-tag-detached branch November 1, 2022 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants