Skip to content

Add unit and e2e tests for AttributionDetailsStep component #112

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

Closed
akmadian opened this issue Mar 5, 2020 · 6 comments · Fixed by #133
Closed

Add unit and e2e tests for AttributionDetailsStep component #112

akmadian opened this issue Mar 5, 2020 · 6 comments · Fixed by #133
Assignees
Labels
💻 aspect: code Concerns the software code in the repository 🤖 aspect: dx Concerns developers' experience with the codebase good first issue New-contributor friendly help wanted Open to participation from the community

Comments

@akmadian
Copy link
Member

akmadian commented Mar 5, 2020

Unit and e2e tests need to be written for the AttributionDetailsStep component. Unit tests are done with Jest, and e2e tests are done with nightwatch.

Please remember to test the following things:

  • That individual parts of the component are present when appropriate. (unit and e2e)
  • That any computed props and methods work properly, if there are any. (unit)
  • Any common interactions between the user and component, if there are any. (e2e)
  • Any other functionality unique to the component being tested!

Additional Context

@akmadian akmadian added help wanted Open to participation from the community good first issue New-contributor friendly test-coverage labels Mar 5, 2020
@akmadian akmadian changed the title Add unit tests for AttributionDetailsStep component Add unit and e2e tests for AttributionDetailsStep component Mar 5, 2020
@akmadian akmadian mentioned this issue Mar 5, 2020
14 tasks
@JackieBinya
Copy link
Contributor

Hello @akmadian
May I please work on this issue.

@akmadian
Copy link
Member Author

akmadian commented Mar 8, 2020

Hey @JackieBinya, go ahead!

@JackieBinya
Copy link
Contributor

Hello @akmadian,

The problem

After finishing my project set-up as well as successfully running the project on the development server. I ran the command npm run test:unit on the terminal so as to run the unit tests, please find attached a screenshot for the message I got on the terminal which, in essence, says there are no tests found in the project as expected.
Screenshot (646)

My questions are:

  • From the project setup I am assuming all unit tests I write are supposed to be written in the ~/tests/unit directory, is that the case?
  • If not please advise where I should write the tests.

@obulat
Copy link
Contributor

obulat commented Mar 9, 2020

That's right, currently there are no tests in the project. The tests you write should be in ~/tests/unit/specs/components/ directory. So, your specific test should be in ~/tests/unit/specs/components/AttributionDetailsStep.spec.js file.

@JackieBinya

This comment has been minimized.

@JackieBinya
Copy link
Contributor

JackieBinya commented Mar 17, 2020

Hello
I have finished writing both unit (commit 4075fd8)and e2e (commit 3db1c5e) tests for the AttributionDetailsStep Component.

I hereby request a code review.

The coverage for the unit tests is 100%
As for the e2e tests:

  • I mainly focused on checking that different elements of the form where visible when the form is loaded. My reason was that there isn't much to test when user submits input as the data is automatically loaded i.e. there isn't any page redirection or message pop up after say a successful submission.
  • To run the e2e tests exclusive to the component, on the terminal run the command:
    npm run test:e2e -- --tag att

@dhruvkb dhruvkb added 💻 aspect: code Concerns the software code in the repository 🤖 aspect: dx Concerns developers' experience with the codebase and removed test-coverage labels Oct 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💻 aspect: code Concerns the software code in the repository 🤖 aspect: dx Concerns developers' experience with the codebase good first issue New-contributor friendly help wanted Open to participation from the community
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants