-
Notifications
You must be signed in to change notification settings - Fork 22
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
fix(ifstep audit trail): fix of ifstep audit trail and context when we use nestedsteps #52
Conversation
…se nestedsteps fix herbsjs#51
test/ifElse/ifElseStep.js
Outdated
}) | ||
}) | ||
|
||
describe('using nested steps with context', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how using nested steps with context
test is different from using nested steps
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nestedsteps use the _stopExecution which came from the context, if we overwrite the context with undefined, then the nestedstep will break.
Seeing this, I put an if and made two tests, with context and without context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, but I could not find the difference between these two test cases. It seems they are exercising the same code / scenario. Could you spot to me the difference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, in the ifElse step, we had step.context = this.context
without if.
With this code in this manner, if we performed that code with usecase context, then will work correctly. But if we run the code without usecase context, the context of the step don't has the _stopExecution and will break the application...
I included an If statement to fix this , then this affects the two flows, for this reason I choose run the "same test" to both contexts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given there is no difference or new input, the test should be just one. Or force the input to be different.
test/ifElse/ifElseStep.js
Outdated
}) | ||
}) | ||
|
||
describe('using nested steps with context', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, but I could not find the difference between these two test cases. It seems they are exercising the same code / scenario. Could you spot to me the difference?
Codecov Report
@@ Coverage Diff @@
## master #52 +/- ##
==========================================
+ Coverage 97.45% 97.50% +0.04%
==========================================
Files 6 6
Lines 236 240 +4
==========================================
+ Hits 230 234 +4
Misses 6 6
Continue to review full report at Codecov.
|
@endersoncosta is the PR name using the correct semantics? https://github.com/herbsjs/buchu/blob/master/.github/CONTRIBUTING.md |
I used the commitizen... And in the contributing.md I can't understand if has any pattern to this matter. |
Agree |
@dalssoft what's left to finish this case? |
@endersoncosta there is an open issue
|
Right, the sceneries was different, but I made some complement to add more sceneries with context... |
@endersoncosta / @dalssoft Anything pending in this PR? |
@endersoncosta need to fix the test code as reviewed before |
the test has been fixed |
test/ifElse/ifElseStep.js
Outdated
}) | ||
}) | ||
|
||
describe('using nested steps with context', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given there is no difference or new input, the test should be just one. Or force the input to be different.
🎉 This PR is included in version 1.3.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
fix buchu bug in audittrail (herbsjs/buchu#52). Add ID field feature in gotu (herbsjs/gotu#52). Add checker isIterable in suma (herbsjs/suma#36). Add javascriptIdentifier in suma (herbsjs/suma#38)
fix #51
Proposed Changes