-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Feedback Page jest tests #670
Comments
This comment was marked as outdated.
This comment was marked as outdated.
Spent some time trying to fix the frontend tests but am unable to get it to pass properly even though I am using patterns I know "should" work. I think that the errors are due to library version compatibility but have not validated this. Next person who picks up this issue, look into versions for the following libraries: jest, react, react-dom, react-testing-library, and maybe nock if we want to use nock. There are ways to test api calls without using nock. |
I wasn't able to spend much time on this. I will do more this week. I'm able to run the simplest nock+axios test https://www.npmjs.com/package/nock#axios |
@nclairesays I only fixed the existing tests in the file. I also read that msw mocks works for both the server and client at the same time, so that might be worth looking into just to save developer time. https://github.com/mswjs/msw |
@nclairesays I might just leave this alone for now. I tried a while ago to test something with that toast provider context and wasn't able get it working. |
Have a discussion with John and Bonnie about the value of continuing this work so that we can prioritize this issue. |
This comment was marked as off-topic.
This comment was marked as off-topic.
I fixed the tests having to do with updating to React 18 ('RuleInput.test.js') but the tests for 'tdm-engine.test.js' need to be updated. I'm switching to issue #780 for now. |
Created a PR for @entrotech so that he can carry out the tests regarding the TDM engine and keep the updates I made regarding the tests having to do with updating to React 18. |
Please provide an update: Progress: "What is the current status of your project? What have you completed and what is left to do?" |
|
@ZekeAranyLucas @agosmou Since you guys seem to be getting into jest testing, I thought I'd have go at trying to fix this long-standing issue. Everything that used to be called Public Comment is changed to Feedback - since the Public Comment period was last year, and we are re-purposing the page for general feedback on the site. I got the first test in FeedbackPage.test.js working, and spent a bit of time trying to get the second test working, but didn't get very far. It seems to be a problem with mocking all the dependencies of for the test properly and/or possibly implementing some sort of wait for the async post to be completed to verfiy that the post is called. It's not clear to me if the feedback.service.test.js test have any value, so I didn't try very hard to get them working. I'd be interested in your opinions. I thought this might be an issue that one of you could figure out. I'm merging the issue to the develop branch, since it is a step forward, and doesn't break anything that was previously working. |
Per @ZekeAranyLucas , the Feedback page tests were unreliable, and preventing us from developing a suite of reliable unit tests. |
Fix breaking Public Comment jest tests so that tests can run in CI pipeline
The text was updated successfully, but these errors were encountered: