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

1676 - Allow '+' in IBDO Form name #502

Merged
merged 2 commits into from
Jun 23, 2023

Conversation

aL118
Copy link
Contributor

@aL118 aL118 commented Jun 20, 2023

Added + to the regex that checks if valid form name and updated unit test. Also updated some comments.

Copy link
Collaborator

@drivenflywheel drivenflywheel left a comment

Choose a reason for hiding this comment

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

Looks good overall. Would like to make some assertion messages less ambiguous.

assertTrue(PayloadUtil.isValidForm("-_"), "Dash and underscore aren't considered valid");
assertTrue(PayloadUtil.isValidForm("formName-(suffixInParens)"), "Parentheses aren't considered valid");
assertTrue(PayloadUtil.isValidForm("formName-(application/xml)"), "Slash aren't considered valid");
assertTrue(PayloadUtil.isValidForm(alphaLow), "Lower case alpha characters are valid");
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should alter each messages in this test to more clearly indicate what the expected result is. The original and proposed messages are ambiguous regarding whether they're stating desired vs observed behavior, but we can take away the ambiguity:

Suggested change
assertTrue(PayloadUtil.isValidForm(alphaLow), "Lower case alpha characters are valid");
assertTrue(PayloadUtil.isValidForm(alphaLow), "Lower case alpha characters are expected to be valid");

or

Suggested change
assertTrue(PayloadUtil.isValidForm(alphaLow), "Lower case alpha characters are valid");
assertTrue(PayloadUtil.isValidForm(alphaLow), "Expected lower case alpha characters to be valid");

assertFalse(PayloadUtil.isValidForm("."), "Dot isn't considered valid");
assertFalse(PayloadUtil.isValidForm(" "), "Space isn't considered valid");
assertTrue(PayloadUtil.isValidForm("+"), "Plus are valid");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
assertTrue(PayloadUtil.isValidForm("+"), "Plus are valid");
assertTrue(PayloadUtil.isValidForm("+"), "'+' is expected to be a valid form character");

@aL118 aL118 changed the title #1757 - Allow '+' in IBDO Form name 1676 - Allow '+' in IBDO Form name Jun 20, 2023
@aL118
Copy link
Contributor Author

aL118 commented Jun 20, 2023

Forgot to add closes #502
Also just realized that title had the wrong issue number so it's been fixed.

Copy link
Collaborator

@ldhardy ldhardy left a comment

Choose a reason for hiding this comment

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

Those previous test assertion messages were completely opposite of the expected behavior, huh? That's confusing, glad it's fixed now.

@drivenflywheel
Copy link
Collaborator

Those previous test assertion messages were completely opposite of the expected behavior, huh? That's confusing, glad it's fixed now.

Maybe? Hard to interpret which message (no pun intended) they were meant to convey, which just increases the time it would take to investigate and resolve a future regression.

Copy link
Collaborator

@drivenflywheel drivenflywheel left a comment

Choose a reason for hiding this comment

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

Looks great. Ready to ship. 🚀

@jpdahlke jpdahlke added this to the v7.19.0 milestone Jun 23, 2023
@jpdahlke jpdahlke merged commit 936ae33 into NationalSecurityAgency:master Jun 23, 2023
10 checks passed
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.

None yet

4 participants