Skip to content
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

feat: Add tests for routes #5

Open
wants to merge 1 commit into
base: Day-3-Onboarding
Choose a base branch
from

Conversation

apurv-wednesday
Copy link
Owner

@apurv-wednesday apurv-wednesday commented Apr 17, 2024

Ticket Link

NA

Related Links

NA

Description

  • Add tests for routes.
  • Add/Fix some paths.
  • Alter the database and add migrations file and accordingly change the model schema.

Steps to Reproduce / Test

Same as Readme.md

Checklist

  • PR description included
  • yarn test passes
  • Tests are [changed or added]
  • Relevant documentation is changed or added (and PR referenced)

GIF's

Screenshot 2024-04-17 at 4 28 17 PM

@@ -30,7 +33,7 @@ const paths = [
{
path: '/oauth2/scopes',
scopes: [SCOPE_TYPE.SUPER_ADMIN, SCOPE_TYPE.ADMIN],
method: 'POST',
method: 'PATCH',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this patch ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to create a seperate item for patch

Comment on lines +13 to +23
validate: {
payload: Joi.object({
userId: Joi.string(),
cabId: Joi.string(),
startPoint: Joi.object({
latitude: Joi.number(),
longitude: Joi.number(),
}),
}),
},
},

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Abstract the validation out

For example rideStart validation. If it is a huge object then you are adding too much in the route. So abstracting will help here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants