Skip to content

Tech debt: Create "integration tests" for resources API #17424

@aalves08

Description

@aalves08

Is your feature request related to a problem? Please describe.

The current unit tests for the resources API resources-api-class.test.ts mock the store. We should create more involved testing where we use the actual store.

Main challenges:
Store setup boilerplate. The dashboard-store module has a lot of state/getters/mutations/actions. You'd need to register the module and populate enough state for the actions to not blow up — at minimum: schemas, type registrations, and the config.namespace that prefixes store paths.

Schema seeding. Actions like findLabelSelector check paginationEnabled, schemaFor, normalizeType, typeRegistered — these all depend on state being pre-populated. You'd need to commit schemas and resource counts before the test runs.

Two code paths. for findLabelSelector branches on paginationEnabled(). You'd want tests for both: SSP enabled (routes to findPage with FilterArgs) and SSP disabled (routes to findMatching with string selector). That means two test setups with different store configurations.

The request action is the natural mock boundary. Everything above it is routing logic, everything below it is HTTP. Mocking at this level gives you real coverage of the arg transformation chain without needing a running server.

Describe the solution you'd like

Describe alternatives you've considered

Additional context

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions