creativecommons / chooser

The new and improved CC license selection tool.
https://chooser-beta.creativecommons.org
MIT License
105 stars 141 forks source link

Rewrite unit tests #316

Closed Cronus1007 closed 3 years ago

Cronus1007 commented 3 years ago

Description

Bugs in unit test Cases

Whenever we run npm run test there are few uncovered lines and few console warnings so there is a need to update the tests to remove the console. warnings and make the tests updated.

Bugs in e2e Test Cases

Few errors are occuring during the execution of the e2e tests with nightwatch and due to these errors e2e testing of Cypress also gets blocked.

@obulat Since the repo is dependent upon the Cypress for e2e test cases. So isn't it safe to remove the nightwatch scripts from the test.

Reproduction

  1. npm run test
  2. Show error

Expectation

Screenshots

Environment

Additional context

Resolution

obulat commented 3 years ago

Thank you for opening the issue, @Cronus1007 . In fact, there are several issues here:

  1. Unit tests The tests we have now are fairly comprehensive. The warning that you can see running the unit tests comes from the scrolling library: since we use shallowMount, the 'Stepper' steps are not mounted during testing, and cannot be found. This warning can be disregarded. There are some lines that are not covered by the unit tests. We welcome any PRs that improve the test coverage, even without an issue.

  2. Integration / e2e testing We are currently in the process of converting the integration tests from Nightwatch to Cypress. Previously, we had one Nightwatch test per component, which mainly repeats the unit tests we already have. Instead, we need to test the way that different components interact. The two main areas we need to test this way is the Stepper and the 'Mark Your Work' section. The Stepper test has already been created. I have opened a new issue with the description of the Cypress tests for the 'Mark Your Work' section. After this issue is solved, we can delete the Nightwatch tests, and use only the Cypress ones. This will remove the issues that you can see in the screenshots above.

I am closing this issue in favor of #318.