Skip to content

test: add unit coverage for ChaosHub output model mapping #5535

Description

@Ju-Min-Kyung

What happened

The ChaosHub faults view contains logic that maps fault data returned from listChaosFaults into the format used by the UI.

Although there are existing tests covering component rendering and tab interactions, there are no tests validating this mapping behavior.

What you expected to happen

Add test coverage for the fault mapping logic to verify that:

  • Fault data is mapped correctly for UI consumption
  • chartName is added correctly to mapped fault objects
  • tag information is preserved during mapping
  • Faults from multiple charts are mapped correctly

Where can this issue be corrected?

chaoscenter/web/src/views/ChaosHub/ChaosFaults.tsx

The fault mapping logic that enriches fault objects with chartName and tag metadata before rendering.

Suggested test file:

chaoscenter/web/src/views/ChaosHub/__tests__/ChaosFaults.test.tsx

Anything else we need to know?

This issue is limited to testing the fault mapping behavior used by the ChaosHub faults view and does not involve backend or API changes.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions