-
Notifications
You must be signed in to change notification settings - Fork 9
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
UIREC-308 Add validation for the claimingInterval
field
#474
Conversation
@@ -73,6 +73,35 @@ describe('TitleForm', () => { | |||
expect(claimingIntervalField).toHaveValue(null); | |||
}); | |||
|
|||
it('should validate \'Claiming interval\' field', async () => { |
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.
I suggest separating all these checks into separate test cases. You have a lot of checks here, if one of them fails, you won't be able to detect which one exactly does. Try the next structure:
describe('when "Claiming active" unchecked', () => {
it('field shouldn't be required')
});
describe('when "Claiming active" checked', () => {
it('field should be required')
});
and so on
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.
Thanks for the suggestion! However, this test is also designed to track the state of the field over time, so it is reduced to one test, this allows us to ensure that validation works when dependent fields change.
993399d
to
f56f81d
Compare
|
Purpose
https://issues.folio.org/browse/UIREC-308
Claiming interval should be a required field when claiming is active for a receiving title.
Approach
Apply validation for claiming interval field when it's required field (claiming active).
Screenshot
chrome_jEfnyWInPk.mp4
Pre-Merge Checklist
Before merging this PR, please go through the following list and take appropriate actions.
If there are breaking changes, please STOP and consider the following:
Ideally all of the PRs involved in breaking changes would be merged in the same day to avoid breaking the folio-testing environment. Communication is paramount if that is to be achieved, especially as the number of intermodule and inter-team dependencies increase.
While it's helpful for reviewers to help identify potential problems, ensuring that it's safe to merge is ultimately the responsibility of the PR assignee.