Giter Site home page Giter Site logo

Comments (3)

MohammedYehia avatar MohammedYehia commented on September 26, 2024

@thejoefriel @othman-shamla @susanX @wright1 @mr-bagglesworth
This is the demo repo for cypress if you all happy with how cypress works then we can add it to this repo
https://github.com/MohammedYehia/cypress-e2e-example

from curenetics.

martinbagshaw avatar martinbagshaw commented on September 26, 2024

@MohammedYehia I think a bit more info might be required here. Assuming, this is a full testing suite that can do unit tests, as well as integration tests...

More render test examples (such as the one render test in app.test.js) might be useful to see. In the context of our app, if a user gets a certain search result, what text, and what correlating colours do we expect the ui to display?

Also, is the main bulk of the testing performed in app.spec.js? I can see you are hitting a route in the app, then testing a classname (i.e. .App). Do you know how this might work with styled components? Given our stack choice, class names won't be as semantic. Might be worth looking into this a bit.

Lastly, a couple more examples of unit tests with plain javascript functions tests might be useful to see, especially as we are going to have a variety of filter functions to process search results.

It feels like smaller unit tests should be the bread and butter, though integration testing is definitely something cool to learn, for me at least!

from curenetics.

MohammedYehia avatar MohammedYehia commented on September 26, 2024

@mr-bagglesworth for the file app.test.js this is from React testing library and I guess we won't be using it

with the styled component, the cypress best practice is to add a custom data attribute like this data-*

<S.comp data-cy="123" />

and then we can use

cy.get("[data-cy=123]").click()

also, you should go with this pattern even if you have classes or ids
with this link, you will find a list full of cypress examples
https://docs.cypress.io/examples/examples/recipes.html

and you can split the tests into multiple files but this is just a demo

from curenetics.

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.