-
Notifications
You must be signed in to change notification settings - Fork 6
Extended tests for manage_taxonomies.jsx file #328
Conversation
There will be some changes coming in regarding the javascript tests so you will need to adjust this PR after my PR is reviewed and merged (#309). Hopefully we'll get a good process nailed down soon for javascript unit tests. |
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.
It looks like you could move this and updateParent
inside the test where they are being used. In general we want to define variables as close to their use as possible
I also did some refactoring in PR #340 FYI, you may want to adjust your code accordingly. The most significant change is that |
One more thing, I noticed that the vocabulary type radio box is not covered by tests, and that failures of various AJAX calls are not covered either. You can look at Thanks for all your help! |
ee2d2c7
to
6e5e6f7
Compare
@noisecapella please review, I think it is ready to merge |
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 variable is used in two tests. Please create a local variable within each test instead. We want to limit global state as much as possible, especially given the complexity of our test framework. The way it is now, one test may affect another tests result which will make test failures hard to debug.
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.
Done
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.
You should move the rest of the code inside this function so that things are executed in proper order and done()
is called only after everything else completes.
Looks good overall, just address the code coverage comment I made and move the code around to avoid race conditions as indicated in my comments, and this should be good to go |
eed1c39
to
f6bf38c
Compare
Done @noisecapella |
Unchecking the learning resource type checkbox is still uncovered. You should be able to test this case by just unchecking it with |
@noisecapella which test you are referring to, please tell me. I have added this check here https://github.com/mitodl/lore/pull/328/files#diff-0f3ee7bcc78eb4497e0092ea2083d2e5R801 for TaxonomyComponent |
@noisecapella also i am testing it is AddVocabulary |
I see the confusion, You currently only check checkboxes which are previously unchecked so the code path that unchecks checkboxes is uncovered. |
got it |
Done @noisecapella |
f6bf38c
to
cdf14ff
Compare
This is great, thanks for your help! |
Extended tests for manage_taxonomies.jsx file
Hi
In this PR I wrote test cases for all reactjs classes i.e VocabularyComponent, TermComponent, AddTermsComponent, AddVocabulary, TaxonomyComponent
#322
@pdpinch @pwilkins @carsongee @noisecapella