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 tag.edited webhook #15555

Merged
merged 4 commits into from
Oct 12, 2022

Conversation

dshubhadeep
Copy link
Contributor

Added e2e tests for tag.edited webhook

Ref - #15537

@daniellockyer daniellockyer requested a review from naz October 7, 2022 09:25
@daniellockyer daniellockyer mentioned this pull request Oct 7, 2022
29 tasks
@codecov
Copy link

codecov bot commented Oct 7, 2022

Codecov Report

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

Coverage data is based on head (424b0fb) compared to base (0c18060).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #15555   +/-   ##
=======================================
  Coverage   52.32%   52.32%           
=======================================
  Files        1446     1446           
  Lines       93493    93493           
  Branches    10437    10437           
=======================================
+ Hits        48920    48923    +3     
+ Misses      43345    43344    -1     
+ Partials     1228     1226    -2     
Impacted Files Coverage Δ
ghost/admin/app/utils/publish-options.js 76.87% <0.00%> (+1.15%) ⬆️
ghost/admin/app/components/gh-dropdown.js 91.83% <0.00%> (+2.04%) ⬆️

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.

@daniellockyer
Copy link
Member

Hey @dshubhadeep 👋🏻 Thanks for all the PRs 🙂

Can I ask that you include refs https://github.com/TryGhost/Ghost/issues/15537 in the actual commit message as per our contributing guide?

I fixed up your previous PR if you'd like to see how it's done: 426168f

refs TryGhost#15537
- this adds an e2e test and test snapshot for the `tag.edited` webhook so we can prevent regressions and bugs in the future
@dshubhadeep
Copy link
Contributor Author

@daniellockyer apologies. I've updated the message.

Copy link
Member

@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.

Minor refactor request, if it's possible. The rest is 👍

})
.matchBodySnapshot({
tag: {
current: {...tagSnapshot, url: anyLocalURL},
Copy link
Member

@naz naz Oct 10, 2022

Choose a reason for hiding this comment

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

Imo, worth including the url: anyLocalURL bit in the shared tagSnapshot object now that it's been used in multiple places. Have you tried moving it @dshubhadeep ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it was done like that before. But tests were failing for tag.deleted webhook since the previous key in the snapshot didn't have the URL.
@naz Maybe I could create a new variable something like snapshotWithUrl ?

Copy link
Member

Choose a reason for hiding this comment

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

Lets keep the extraction to the rule of 3. If we have to reuse the same form 3rd time lets extract a tagSnapshotWithURL like you proposed or create a builder function having a "withURL: boolean" parameter. It's been used 2 times now, so it's good to go as is 👍

@ErisDS ErisDS changed the title Added e2e test for tag.edited webhook Added e2e tests for tag.edited webhook Oct 12, 2022
@ErisDS ErisDS merged commit 8374c73 into TryGhost:main Oct 12, 2022
@ErisDS
Copy link
Member

ErisDS commented Oct 12, 2022

Hi @dshubhadeep thanks so much for this PR. Sorry for the delay, but this has now been merged 🎉 and will appear in the next release of Ghost - usually Fridays.

I'm not sure if you found this through hacktoberfest, but I've added the accepted label to this PR to make sure it counts. We have plenty of open issues and ongoing projects for hacktoberfest and beyond. We would love to see you around again 👋

@dshubhadeep dshubhadeep deleted the test-tag-edited-webhook branch October 13, 2022 04:22
sam-lord pushed a commit that referenced this pull request Oct 17, 2022
refs: #15537

- this adds an e2e test and test snapshot for the `tag.edited` webhook so we can prevent regressions and bugs in the future

Co-authored-by: Hannah Wolfe <github.erisds@gmail.com>
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.

None yet

4 participants