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

[no-Jira] Improve test coverage #851

Merged
merged 5 commits into from
Jan 11, 2024
Merged

[no-Jira] Improve test coverage #851

merged 5 commits into from
Jan 11, 2024

Conversation

canac
Copy link
Contributor

@canac canac commented Dec 20, 2023

Increase the test coverage of some of the most frequently-modified files.

Copy link
Contributor

@wrandall22 wrandall22 left a comment

Choose a reason for hiding this comment

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

For the most part this looks really good and adds some good code coverage, thanks!

Some things to note:

  1. You asked about commits, some things you could have done, which may have been slightly nicer, would have been to put the commit "Remove redundant GET request" after the test commits (TDD principle). You could also have combined the cleanup commits for eventForm.js into a single commit and have the description be a bulleted list of the cleanup actions done.

  2. There are a few places where the test sentencing is a bit weird, I believe you did this to avoid putting a describe block around a single it block but retain the function name. There are probably trade-offs to readability and useless boilerplate here. I'm ok either way on it, but it does seem a tad jarring to read.

  3. There are quite a few places (new and old) where tests are referencing hard-coded UUIDs and text. We should really work towards removing this habit from the codebase and use the reference locations of these values instead. Otherwise, if we change a value in the testData.spec.js file we'll have to search and replace it all over the codebase instead of it just working properly.

test/spec/controllers/reviewRegistration.spec.js Outdated Show resolved Hide resolved
test/spec/controllers/reviewRegistration.spec.js Outdated Show resolved Hide resolved
test/spec/controllers/reviewRegistration.spec.js Outdated Show resolved Hide resolved
test/spec/controllers/reviewRegistration.spec.js Outdated Show resolved Hide resolved
test/spec/controllers/reviewRegistration.spec.js Outdated Show resolved Hide resolved
test/spec/controllers/eventRegistrations.spec.js Outdated Show resolved Hide resolved
test/spec/controllers/eventRegistrations.spec.js Outdated Show resolved Hide resolved
test/spec/controllers/eventRegistrations.spec.js Outdated Show resolved Hide resolved
app/scripts/controllers/eventForm.js Outdated Show resolved Hide resolved
app/scripts/controllers/eventRegistrations.js Outdated Show resolved Hide resolved
test/spec/controllers/eventForm.spec.js Outdated Show resolved Hide resolved
test/spec/controllers/eventRegistrations.spec.js Outdated Show resolved Hide resolved
test/spec/controllers/eventRegistrations.spec.js Outdated Show resolved Hide resolved
test/spec/controllers/eventRegistrations.spec.js Outdated Show resolved Hide resolved
@canac canac force-pushed the test-coverage branch 2 times, most recently from e60d16d to 396c0eb Compare January 4, 2024 17:30
* Simplify allowGroupRegistration calculation
* Use an object for regValidate map
* Document non-existent properties
* Merge identical functions
* Simplify pageIsVisible check
* Remove unused dependency
* Remove redundant statement
* Improve makePositionArray readability
Copy link
Contributor

@dr-bizz dr-bizz left a comment

Choose a reason for hiding this comment

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

Thank you for adding this coverage!

@canac
Copy link
Contributor Author

canac commented Jan 10, 2024

@wrandall22 Do you want to take another look, or should I dismiss your review?

@canac canac merged commit 9fc9ce2 into master Jan 11, 2024
14 checks passed
@canac canac deleted the test-coverage branch January 11, 2024 21:14
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.

3 participants