-
Notifications
You must be signed in to change notification settings - Fork 63
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
Add unit test for search history end points #78
Comments
hey @jkwening. I am thinking of tackling this issue. However when I run npm test I get an error Cannot find module '../src/components/SigninForm' It is coming from components.test.js in the client folder. I don't see any folder by that name in the components directory. Maybe your team is already aware of this? I am just gonna comment out that test for now and work on this issue. |
@Euklidian-Space yeah that's fine; the front end code base has change a lot since this issue was created. The related component is now in @motosharpley can you add him to the group? Thanks. |
hey @jkwening, I have a question, For postSavedPins in saved-pins-controller.js there is a part in the function definition where it is checking if a pin exists in the database. It does that by looking at appReq.body.lat and appReq.body.lng . I cannot seem to find where in the middleware pipeline those properties get set. I know for this particular route verifyToken is called before postSavedPins but verify token does not mutate the body property on the appReq object. I only ask this because the first test for POST /search/savedpins route in saved-pins-test.js is failing when i run npm test. These were test that were written before me taking on this task. |
Hi @Euklidian-Space Did that help? |
@jkwening I figured it out. I didn't notice to call to .send() in the promise chain of the test. Whoever wrote this test was sending in a pin that was already being inserted into the test DB through the beforeEach(populatePins) call. I changed the test so that it correctly sends a new pin that hasn't already been inserted into the DB. I'll include it with my changes. |
@jkwening PR submitted. |
@jkwening PR was merged. This issue can be closed out. |
See #59 for context. Implement unit test for the routing end points needed. You will need to incorporate authentication into test case since this will be secured data (see #38 and #76 for related information). You can reference savedPins file in tests for an example and routes/users.js and routes/saved-pins regarding routes and their controller functions.
The text was updated successfully, but these errors were encountered: