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

Posts connector test implemented. #1121

Merged
merged 3 commits into from
Sep 30, 2020
Merged

Conversation

kidunot89
Copy link
Contributor

Partially fixes #1093

Summary checklist

  • Adds transition_post_status callback test
  • Adds deleted_post callback test

@kidunot89 kidunot89 self-assigned this Jun 30, 2020
@kidunot89 kidunot89 changed the title Tests/posts connector Posts connector test implemented. Jul 2, 2020
@kidunot89 kidunot89 requested a review from kopepasah July 24, 2020 17:17
Copy link
Member

@dero dero left a comment

Choose a reason for hiding this comment

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

@kidunot89 Good progress here! Added a few comments and a question. May have also potentially found a bug in Stream, but want to confirm with you first as I'm new to the codebase.

@kidunot89 kidunot89 requested review from dero and removed request for kopepasah September 17, 2020 18:16
@kidunot89
Copy link
Contributor Author

@dero All requested changes have been made. Please review this again.

Copy link
Member

@dero dero left a comment

Choose a reason for hiding this comment

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

LGTM, thank you.

I created #1176 to separately track the issue with log misinterpreting post status transitions from new as posts being updated instead of post being created.

@@ -255,7 +256,7 @@ public function callback_transition_post_status( $new, $old, $post ) {
);
}

if ( 'auto-draft' === $old && 'auto-draft' !== $new ) {
if ( in_array( $old, $start_statuses, true ) && ! in_array( $new, $start_statuses, true ) ) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dero Does this resolve #1176? This will update the action to be created when the old status is new, auto-draft, or inherit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've also update the tests to confirm that changes 👍

Copy link
Member

Choose a reason for hiding this comment

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

@kidunot89 This looks great, thanks!

@kidunot89 kidunot89 requested a review from dero September 24, 2020 15:18
Copy link
Member

@dero dero left a comment

Choose a reason for hiding this comment

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

LGTM now! 👍

@@ -255,7 +256,7 @@ public function callback_transition_post_status( $new, $old, $post ) {
);
}

if ( 'auto-draft' === $old && 'auto-draft' !== $new ) {
if ( in_array( $old, $start_statuses, true ) && ! in_array( $new, $start_statuses, true ) ) {
Copy link
Member

Choose a reason for hiding this comment

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

@kidunot89 This looks great, thanks!

@dero dero merged commit fdb8a06 into xwp:develop Sep 30, 2020
@kasparsd
Copy link
Contributor

Was this change related to this failing unit test? https://travis-ci.com/github/xwp/stream/jobs/393230336#L512

I wonder why the Travis checks didn't run for this pull request.

@kidunot89
Copy link
Contributor Author

No, but it's small issue, I'll fix it another PR.

@kidunot89 kidunot89 deleted the tests/posts-connector branch October 1, 2020 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve Test Coverage
3 participants