keyshade-xyz / keyshade

Realtime secret and configuration management tool, with the best in class security and seamless integration support
https://keyshade.xyz
Mozilla Public License 2.0
196 stars 96 forks source link

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

Closed muntaxir4 closed 2 months ago

muntaxir4 commented 2 months ago

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

rajdip-b commented 2 months ago

You can get started with this ASAP!

muntaxir4 commented 2 months ago

You can get started with this ASAP!

Sure, on it.

muntaxir4 commented 2 months ago

@rajdip-b This is fixed for each module with these PRs https://github.com/keyshade-xyz/keyshade/pull/382 https://github.com/keyshade-xyz/keyshade/pull/387 https://github.com/keyshade-xyz/keyshade/pull/388 https://github.com/keyshade-xyz/keyshade/pull/389 https://github.com/keyshade-xyz/keyshade/pull/390 https://github.com/keyshade-xyz/keyshade/pull/391 https://github.com/keyshade-xyz/keyshade/pull/393 #394 .