Skip to content

[Bug]:Snapshot tests for SchemaHelpers.applicatorSchemaName rely on undocumented rendering behavior #1225

@SHUBHANSHU602

Description

@SHUBHANSHU602

Description

The snapshot tests for SchemaHelpers.applicatorSchemaName validate output using stored snapshots without documenting or asserting the rendering contract.

The output depends on:
index position
title presence / absence
implicit whitespace and formatting rules

Because these rules are not explicitly asserted, snapshot updates can silently lock in unintended behavior or formatting regressions.
This makes the tests opaque and fragile during refactoring.

Image

Expected Behavior

Tests should clearly assert the intended rendering contract, such as:
when the title is rendered
how the index affects output
how formatting is expected to behave
Snapshot tests should either:
be replaced with explicit expectations, or
document the rendering rules they enforce

Steps to Reproduce

Open schema.test.ts
Navigate to the SchemaHelpers.applicatorSchemaName test block
Modify rendering logic slightly (e.g., whitespace or title formatting)
Observe that snapshot tests fail without clearly indicating what rule was broken

File Affected:-asyncapi-react/library/src/helpers/tests/schema.test.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions