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

API: Add support for url to include page and limit in e2e Tests. #392

Closed
muntaxir4 opened this issue Jul 28, 2024 · 3 comments
Closed

API: Add support for url to include page and limit in e2e Tests. #392

muntaxir4 opened this issue Jul 28, 2024 · 3 comments
Assignees
Labels
difficulty: 3 help wanted Extra attention is needed priority: urgent scope: api Everything related to the API type: bug Something isn't working

Comments

@muntaxir4
Copy link
Contributor

muntaxir4 commented Jul 28, 2024

Description

Currently, while adding page and limit to URLS in tests the service modules has to explicitly convert those to numbers. The query params are parsed as strings, since NestJS doesn't covert numeric query parameters to numbers by default.

Type of limit when not explicitly converted during tests:
image

Solution

Initialize app with globalPipe using QueryTransformPipe. Finally, remove those explicit conversions.
image

Alternatives

Directly, using QueryTranformPipe at required controllers. Eg: @Query('limit', QueryTransformPipe)

Affected e2e modules

Modules that are using page and limit: environment.e2e.spec.ts, project.e2e.spec.ts, workspacee2e.spec.ts, workspace-role.e2e.spec.ts, secret.e2e.spec.ts, variable.e2e.spec.ts, event.e2e.spec.ts

@muntaxir4 muntaxir4 changed the title API: Add support for url with page and limit in e2e Tests. API: Add support for url to include page and limit in e2e Tests. Jul 28, 2024
@rajdip-b
Copy link
Member

You can get started with this ASAP!

@rajdip-b rajdip-b added type: bug Something isn't working help wanted Extra attention is needed scope: api Everything related to the API priority: urgent difficulty: 3 labels Jul 28, 2024
@rajdip-b rajdip-b moved this to Todo in keyshade-api Jul 28, 2024
@muntaxir4
Copy link
Contributor Author

You can get started with this ASAP!

Sure, on it.

@muntaxir4 muntaxir4 changed the title API: Add support for url to include page and limit in e2e Tests. API: Add support for url to include page and limit in e2e and unit Tests. Jul 28, 2024
@muntaxir4 muntaxir4 changed the title API: Add support for url to include page and limit in e2e and unit Tests. API: Add support for url to include page and limit in e2e Tests. Jul 28, 2024
@muntaxir4
Copy link
Contributor Author

@rajdip-b This is fixed for each module with these PRs #382 #387 #388 #389 #390 #391 #393 #394 .

@github-project-automation github-project-automation bot moved this from Todo to Done in keyshade-api Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: 3 help wanted Extra attention is needed priority: urgent scope: api Everything related to the API type: bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

2 participants