API: Add support for url to include page and limit in e2e Tests. #392
Labels
difficulty: 3
help wanted
Extra attention is needed
priority: urgent
scope: api
Everything related to the API
type: bug
Something isn't working
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:
Solution
Initialize app with globalPipe using QueryTransformPipe. Finally, remove those explicit conversions.
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
The text was updated successfully, but these errors were encountered: