Terrastories / terrastories

Terrastories is a geostorytelling application for mapping, managing and sharing place-based stories.
https://terrastories.app
MIT License
319 stars 157 forks source link

[Javascript Testing] Add tests for Card component #514

Closed FeminismIsAwesome closed 4 years ago

FeminismIsAwesome commented 4 years ago

Background:

We would like more confidence, especially with desires to update the UI and add new map-facing features, that the javascript is rendering as expected. This is a good place for those new to the project to start getting familiar with the javascript end of things.

Let's add tests for the Card.jsx component!

Some suggestions for tests:

Adding an enzyme snapshot test (https://medium.com/codeclan/testing-react-with-jest-and-enzyme-20505fec4675) Asserting that different if-block renders render with the right data (different user roles) Testing interactions, like "when this clicks, this state changes"

Acceptance:

Running docker-compose exec web yarn test with the new tests does not break the javascript test suite.

leosoaivan commented 4 years ago

I'll take a stab at this one!

leosoaivan commented 4 years ago

I think this issue is okay to closed, resolved in https://github.com/Terrastories/terrastories/pull/519? I'll make sure to link next time.

FeminismIsAwesome commented 4 years ago

Ahh yes! Thanks for calling that out.