codihuston / gairos

A time-keeper and scheduler for tasks
9 stars 2 forks source link

Implement unit/integration/end-to-end testing in front-end #11

Open codihuston opened 4 years ago

codihuston commented 4 years ago

Great read for react testing with enzyme, mocha, and sinon: https://www.robinwieruch.de/react-testing-mocha-chai-enzyme-sinon

codihuston commented 4 years ago

E2e using cypress: https://www.robinwieruch.de/react-testing-cypress

codihuston commented 4 years ago

E2e would test all of the app as if you were an end user. You would likey mock out any external services (backend api responses, etc.)

codihuston commented 4 years ago

If you would like to do e2e testing across both the front and back end, it may be ideal to use the CDC approach.

If not, you would generally peogramatically query the app individually, and ensure that it responds a certain way. You may implement services, like databases, in these tests.

I.e.) use a lib to render the react app, verify that upon interacting with it and its components, the UI looks as it should

codihuston commented 4 years ago

https://reflectoring.io/pact-react-consumer/

codihuston commented 4 years ago

Implemented unit testing with enzyme as of 5da3c4f. Should be able to do integration testing with enzyme as well. Placing on hold for now, until I decide how to e2e testing.