Skip to content

[Task](ui): fix and improve wrong and nonsensical test descriptions across components #1590

@franzheidl

Description

@franzheidl

Nine components have test descriptions that are factually wrong, reference the wrong component, or contain typos significant enough to be misleading. Most are copy-paste artefacts.

Wrong Component Names

Radio

Radio.test.tsx:36 reads:

"renders a Checkbox with an auto-generated id if no id was passed"

The test renders a Radio and asserts on a radio element. Replace with "renders a Radio with an auto-generated id if no id was passed".

GridColumn

GridColumn.test.tsx:14 reads:

"renders a Grid row"

Replace with "renders a GridColumn".

TopNavigationItem

TopNavigationItem.test.tsx:20 and :77 both read "renders a ToppNavigationItem" (double p). Replace with "renders a TopNavigationItem" in both.

Copy-Pasted Placeholder Values

FormattedText

FormattedText.test.tsx:13 and :20 use data-testid="my-pagination" — copied from the Pagination component. Replace with data-testid="my-formatted-text" in both tests (and update the getByTestId calls accordingly).

Truncated or Garbled Descriptions

Toast

  • Toast.test.tsx:29: "render an sucess toast" — typo "sucess". Replace with "renders a success toast".
  • Toast.test.tsx:41: "render an danger toas" — truncated "toast". Replace with "renders a danger toast".
  • Toast.test.tsx:78: "renders a toast e that will be automatically dismissed" — stray e. Replace with "renders a toast that will be automatically dismissed".

Select

Select.test.tsx:70: "renders a default variant select toggle by defgault" — typo "defgault". Replace with "renders a default variant select toggle".

SelectDivider

SelectDivider.test.tsx:22: "renders all pops as passed" — typo "pops" for "props". Replace with "renders all props as passed".

Misleading Prop Name in Description

ModalFooter

ModalFooter.test.tsx:29: "renders a ModalFooter with a 'Confirm' and a 'Cancel' button when an onComfirm handler is passed" — misspells the prop as onComfirm. The actual prop is onConfirm. Update the description to match.

Swapped Test Files

FormRow.test.tsx and FormSection.test.tsx are entirely swapped — each file tests the other component. The test content in each file needs to be moved to the correct file, or the two files need to be swapped.

Sub-tasks

  • Radio: fix description at line 36 — "Checkbox" → "Radio"
  • GridColumn: fix description at line 14 — "Grid row" → "GridColumn"
  • TopNavigationItem: fix "ToppNavigationItem" typo at lines 20 and 77
  • FormattedText: replace data-testid="my-pagination" with data-testid="my-formatted-text" at lines 13 and 20
  • Toast: fix "sucess" at line 29, "toas" at line 41, stray "e" at line 78
  • Select: fix "defgault" typo at line 70
  • SelectDivider: fix "pops" typo at line 22
  • ModalFooter: fix "onComfirm" typo at line 29
  • FormRow / FormSection: swap test file contents to the correct files

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    ui-componentsAll tasks related to juno-ui-components library

    Type

    Projects

    Status

    New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions