Redocly / Redocly/redoc

How to best smoke test that redoc renders correctly?

Open
#2,256 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Type: Enhancement
Dominant language
TypeScript
Stars
25.9k
Forks
2.4k
Avg merge
13h 10m
Merged PRs (30d)
4

Description

I have previously published updates that broke Redoc rendering (for example, due to an invalid schema reference). This gives the "an error occurred" screen with red text and a stack trace.

I'm therefore after a stable, simple check that verifies that Redoc manages to render anything at all. This would allow me to include smoke tests that verify that this does not happen. How can I best do this?

For example, I could check for the existence of an element with the redoc-wrap or api-content classes, but this may create brittle tests: I have no guarantee that these won't change in the future and therefore break my smoke tests even though it renders correctly.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test path is named. Start by reviewing Redoc's rendering smoke-test setup and the DOM around the redoc-wrap and api-content classes, comparing successful rendering with the "an error occurred" screen. Done means a stable check distinguishes rendered content from the error state without relying on brittle implementation classes.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation, testing-qa
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.