-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 submit and close next steps for optimistically created policy #39563
Merged
Changes from 11 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
f07344b
Add some default policy values
mountiny 0860477
Make sure we create the workspace with correct harvesting and approva…
mountiny 3131c5d
Remove deprecated isPreventSelfApprovalEnabled policy property
mountiny 652b2f3
Merge main
mountiny ebf0eaa
Create correct next steps when the report is submitted in the submit …
mountiny 26e41dc
Add unit test for the submit and close next steps
mountiny bcb3110
Make sure the next steps are included in the optimistic data when sub…
mountiny 36c91d2
Include the next steps in failure data when submitting no matter what…
mountiny 67c18ce
Update the unit tests
mountiny fc36c7c
Fix style
mountiny 356bbd0
Revert podfile lock changes
mountiny eb24a0a
Update IOU tests
mountiny 737788b
Add comment to explain test
mountiny 2d9027e
Merge branch 'main' into vit-39337
mountiny File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -442,6 +442,24 @@ describe('libs/NextStepUtils', () => { | |
|
||
expect(result).toMatchObject(optimisticNextStep); | ||
}); | ||
|
||
test('submit and close approval mode', () => { | ||
report.ownerAccountID = strangeAccountID; | ||
optimisticNextStep.title = 'Finished!'; | ||
optimisticNextStep.message = [ | ||
{ | ||
text: 'No further action required!', | ||
}, | ||
]; | ||
|
||
return Onyx.merge(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`, { | ||
approvalMode: CONST.POLICY.APPROVAL_MODE.OPTIONAL, | ||
}).then(() => { | ||
const result = NextStepUtils.buildNextStep(report, CONST.REPORT.STATUS_NUM.CLOSED); | ||
|
||
expect(result).toMatchObject(optimisticNextStep); | ||
}); | ||
}); | ||
}); | ||
|
||
describe('it generates an optimistic nextStep once a report has been approved', () => { | ||
|
@@ -553,13 +571,5 @@ describe('libs/NextStepUtils', () => { | |
expect(result).toMatchObject(optimisticNextStep); | ||
}); | ||
}); | ||
|
||
describe('it generates a nullable optimistic nextStep', () => { | ||
test('closed status', () => { | ||
const result = NextStepUtils.buildNextStep(report, CONST.REPORT.STATUS_NUM.CLOSED); | ||
|
||
expect(result).toBeNull(); | ||
}); | ||
}); | ||
Comment on lines
-556
to
-563
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe this usecase is only in the Cancel payment flow and even in that one I think its fair so show the Finished no further action required message. So its safe to remove |
||
}); | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This is no longer being sent from backend so we can remove it