Giter Site home page Giter Site logo

Comments (6)

obulat avatar obulat commented on September 7, 2024 1

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.

from chooser.

JackieBinya avatar JackieBinya commented on September 7, 2024

Hello @akmadian
May I please work on this issue.

from chooser.

akmadian avatar akmadian commented on September 7, 2024

Hey @JackieBinya, go ahead!

from chooser.

JackieBinya avatar JackieBinya commented on September 7, 2024

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.

from chooser.

JackieBinya avatar JackieBinya commented on September 7, 2024

Hello
I have encountered a blocker whilst trying to write e2e tests for the AttributionDetailsStep Component.
Most of the components that precede the AttributionDetailStep component do not have unique identifiers/selectors hence its making it impossible to mimic user behavior.
I will attach a screenshot using the FirstStep Component to further explain what I am trying to achieve.
Screenshot from 2020-03-16 19-18-32

I want mimic a user clicking Yes. I know which license I need radio button using Nightwatchjs. But there is no unique identifier/selector that currently will enable me to do that.
The .b-radio class selects both No(Line 30) and Yes(Line 17) radio buttons. This is as seen on the Chrome Dev Tools. The selector is not unique.
Is there possible a work-around I can use to access the radio button.
My suggestion was to use data attributes i.e data-e2e='yes-First-Step'

from chooser.

JackieBinya avatar JackieBinya commented on September 7, 2024

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

from chooser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.