[ENG-10364] Part 1: Add unit tests for preprints#895
[ENG-10364] Part 1: Add unit tests for preprints#895nsemets wants to merge 3 commits intoCenterForOpenScience:feature/pbs-26-2from
Conversation
brianjgeiger
left a comment
There was a problem hiding this comment.
A couple of questions, and one test that looks like it might not be testing everything it says it is.
| <osf-review-step [provider]="preprintProvider()" /> | ||
| @let provider = preprintProvider(); | ||
|
|
||
| @if (provider) { |
There was a problem hiding this comment.
Is there a case where a preprint wouldn't have a provide, I wonder? And if so, does this mean that they wouldn't be able to add a version?
I think all preprints should have a provider, so probably this is useful from a code safety measure, but shouldn't be bypassed in actual use.
| it('should compute latest withdrawal request correctly', () => { | ||
| const latestRequest = component.latestWithdrawalRequest(); | ||
| expect(latestRequest).toBe(mockWithdrawalRequests[0]); | ||
| it('should show toast error for 409 on create new version', () => { |
There was a problem hiding this comment.
Is this the ideal workflow here?
| it('should compute is pending withdrawal', () => { | ||
| const pending = component.isPendingWithdrawal(); | ||
| expect(typeof pending).toBe('boolean'); | ||
| it('should show edit button for latest or initial preprint', () => { |
There was a problem hiding this comment.
Is this actually also testing for latest version, or just initial version?
brianjgeiger
left a comment
There was a problem hiding this comment.
A couple of questions, and one test that looks like it might not be testing everything it says it is.
Summary of Changes