-
-
Notifications
You must be signed in to change notification settings - Fork 174
Description
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.
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