-
-
Notifications
You must be signed in to change notification settings - Fork 163
Add unit tests for license-uitilities.js #125
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
Comments
Hello. Could I work on the test coverages? |
Go ahead! @acagastya |
@akmadian Hi. Could you please tell me how to organise the tests? In which directory am I supposed to put it under? |
It should be organized similarly to how component tests are organized. Just like component unit tests go in |
Okay, thank you. :-) |
@akmadian While writing the tests, I just realised, the function Do we assume the parameters passed to the function will correspond to a valid license? Or should the function return an error? |
I think it's safe to assume that the ND and SA incompatability won't be an issue, the ability to make a selection for SA is disabled when ND is selected, so it's theoretically impossible for that specific configuration to get passed in. So, to answer your question directly, it's safe to assume that the parameters passed will correspond to a valid license. |
Thank you for the swift response, @akmadian. I found another oddity. Is that how they are supposed to behave? |
Thanks for catching this, I would say that for now, yes, this is expected behavior. The person who wrote this code is @obulat, and she's gonna be unavailable for a while, and I'm unsure if this is expected behavior. Let's assume that this behavior is expected for now, and we can re-examine once @obulat is back :) |
Okay, point noted. And I have duly updated the tests. Thank you for letting me know. :-) |
@akmadian I had been thinking of edge cases, and unsurprisingly, |
Yes, I think that's safe to assume |
Thank you for catching this issue, @acagastya ! At first, we had CC BY license set by default, and all attributes were set to false (except for BY, which was set to true) at the beginning. Then we decided not to have a default license choice, so all attributes became Could you update |
@obulat Sure thing, I will do that. And update the tests accordingly. Thank you for letting me know the context. And I agree with your way of approaching this. Creative Commons licenses (especially version 4.0) are very clear about the requirements and explicitly state what is true, what is defined. If something is not defined (and marked as |
Hi, I am sorry for the delay. I will be submitting the PR in a few hours. |
@obulat Just a quick clarification, what should be the output of |
Unit tests need to be written for license-utilities.js. Unit tests are done with Jest.
Please remember to test the following things:
Additional Context
The text was updated successfully, but these errors were encountered: