hackforla / 311-data

Empowering Neighborhood Associations to improve the analysis of their initiatives using 311 data
https://hackforla.github.io/311-data/
GNU General Public License v3.0
62 stars 64 forks source link

Implement an automated front-end testing framework for React components #1334

Open edwinjue opened 2 years ago

edwinjue commented 2 years ago

Dependency

Overview

We need to implement automated React components tests so that non-working code does not accidentally get introduced to the production website.

Action Items

Dependency

Resources/Instructions

https://jestjs.io/ https://testing-library.com/

mc759 commented 1 year ago

Hey @edwinjue, Do you have an update for us on this issue?

Please update:

Thanks!

bberhane commented 5 months ago

@ryanfchase What's the status of this ticket?

ryanfchase commented 5 months ago

I don't think progress has been made on this, it should not be in-progress.

I think this ticket is blocked until we have a member who is very comfortable with Javascript testing frameworks to take the lead on this. We'll need to come up with a strategy for integrating testing into our project. I'm going to move this to icebox under said reasoning.

aqandrew commented 5 months ago

Hi! I've written frontend tests for a couple of my projects:

and would like to lead work on this issue. I think 8pt is an appropriate size, and I'm comfortable writing documentation for our testing practices.

Notes

Questions

  1. Are user flows written out and listed somewhere? This will help us to write e2e (end-to-end) tests.
ryanfchase commented 5 months ago

Are user flows written out and listed somewhere? This will help us to write e2e (end-to-end) tests.

@aqandrew we have a variety of flows documented, but some are not covered yet. Check out the Figma page here.

ryanfchase commented 5 months ago

@aqandrew I think we're good to open this ticket up to be worked on. I approve of the action items, and I've added action items for me to create the testing Epic and integration test ticket template.

If you agree, please do the following...

aqandrew commented 5 months ago

@ryanfchase Sounds good! Just a couple more notes worth mentioning--want to leave a paper trail of this info:

ryanfchase commented 5 months ago

We should add another action item for setting up CI (continuous integration) for tests. What this looks like is configuring a GitHub Action to run tests on every PR made to the main branch. Then merging would be blocked until additional commits are pushed to make any failing tests pass. @Skydodle is on board with this idea too

Sounds good. Absolutely, we should pursue this. Go ahead and modify the action items to include this.

I’m thinking about starting an issue to jot down every time someone provides information that should go in a wiki. I am making a mental note of your comment, and then adding to my todo list from Wednesday to create a wiki page compilation ticket.

ryanfchase commented 5 months ago

I've modified the milestone to reflect the correct level of prioritization and importance. This ticket is now available to be picked up.

aqandrew commented 5 months ago

I’m thinking about starting an issue to jot down every time someone provides information that should go in a wiki.

Good idea! Though I think we can live without this particular info going into the wiki. The approach I want to take is the same as what's currently documented in the latter half of contributing.md:

https://github.com/hackforla/311-data/blob/a16ce587e937e5b6a52579e6f8ebecc5e628c92e/contributing.md?plain=1#L15-L23

(^This actually answers a question I'd had about the All PR Status checks are successful checklist item in the PR template. I guess status checks were not yet implemented when the PR template was created)

ryanfchase commented 5 months ago

@aqandrew that's true, we did have this in our contributing.md. No sweat, we can coordinate on how we approach the wiki -- I'll make sure we cover it at the upcoming engineering meeting.

ryanfchase commented 5 months ago

@aqandrew FYI I've actually added an action item to the Testing Epic for implementing the CI you mentioned above. Ofc, you're still free to add a similar action item here, I'll just make a note in the epic. But if you want, we can split up the CI work into its own ticket to make this ticket easier to close: https://github.com/hackforla/311-data/issues/1768

aqandrew commented 5 months ago

Sounds good! I think the CI work should go in its own ticket. Since we'll be telling the CI environment to run test commands in the main branch, it'll be helpful to have the testing code merged to main.

aqandrew commented 5 months ago

ETA: 7/17/24

bberhane commented 5 months ago

Hi @aqandrew,

Please leave a comment with the following items:

ryanfchase commented 3 months ago

@aqandrew iirc you had switched gears to work on this ticket: https://github.com/hackforla/311-data/issues/1778

I think we ought to shelve this and move it to the Icebox while we wait for the other ticket to go through -- since we agreed it would be easier to approach once we have Vite

aqandrew commented 3 months ago

That's correct, thank you for the reminder Ryan!