Skip to content

Fix api-guides.cy.js feedback-section selector ambiguity #1237

Description

@PedroAntunesCosta

Description

The feedback test uses a selector that matches more than one feedback widget on normal guide pages, making the interaction ambiguous and the assertion unreliable.

Evidence

  • src/tests/cypress/integration/api-guides.cy.js calls cy.get('[data-cy="feedback-section"]').scrollIntoView().
  • src/components/article-render/index.tsx renders one FeedbackSection below the article content and another inside TableOfContents when hideTOC is false.
  • @vtexdocs/components applies data-cy="feedback-section" to the root element of each widget.

Recommended Change

Give the primary feedback widget a unique selector, or scope the test to a single container (article footer vs TOC panel) before interacting with it.

Acceptance Criteria

  • The test passes on /docs/guides/brands and at least one other guide page.
  • The selector resolves to exactly one element before scrollIntoView() and the feedback flow still verifies the expected success text.

Files

  • src/tests/cypress/integration/api-guides.cy.js
  • src/components/article-render/index.tsx and/or a dependency update to @vtexdocs/components

Context

Extracted from the PR #1226 CI checks investigation. See plans/PR-1226-ci-checks-investigation.md (Issue 4) for the full analysis.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions