Skip to content

Conversation

@calvin-codecov
Copy link
Contributor

@calvin-codecov calvin-codecov commented Nov 25, 2025

Closes https://linear.app/getsentry/issue/CCMRG-918/components-drop-down-in-components-tab-displays-the-list-of-component

Changes from id names to pretty names.

Before:
Screenshot 2025-11-24 at 4 56 39 PM
After:
Screenshot 2025-11-24 at 4 56 24 PM


Note

Switches ComponentsTab dropdown to display component names instead of IDs.

  • UI (ComponentsTab): In src/pages/RepoPage/CoverageTab/ComponentsTab/Header/Header.tsx, map dropdown items to component.name instead of component.id for the multi-select.

Written by Cursor Bugbot for commit 61cca7a. This will update automatically on new commits. Configure here.

Copy link
Contributor Author

Comment on lines 47 to +48
const componentNames = componentsData?.components?.map(
(component) => component?.id
(component) => component?.name
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Type mismatch in MultiSelect component: items are strings, selectedItemsOverride are objects, causing isEqual to fail.
Severity: CRITICAL | Confidence: High

🔍 Detailed Analysis

The MultiSelect component receives an array of strings (component?.name) for its items prop, but an array of Component objects ({name, id}) for its selectedItemsOverride prop. The internal isItemSelected function uses lodash.isEqual to compare these, which returns false when comparing a string (e.g., 'Component 1') with an object (e.g., {name: 'Component 1', id: 'component1'}). This type mismatch prevents correct item selection matching, causing all dropdown items to appear as unselected, leading to visual duplicates and a broken selection UI. A related test in Header.test.tsx will also fail as it expects to find the component's id.

💡 Suggested Fix

Ensure the items prop passed to MultiSelect is an array of Component objects ({name, id}) to match the type of selectedItemsOverride and the onChange handler's expected input. This can be achieved by mapping componentNames to the full Component objects instead of just their name property.

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: src/pages/RepoPage/CoverageTab/ComponentsTab/Header/Header.tsx#L47-L48

Potential issue: The `MultiSelect` component receives an array of strings
(`component?.name`) for its `items` prop, but an array of `Component` objects (`{name,
id}`) for its `selectedItemsOverride` prop. The internal `isItemSelected` function uses
`lodash.isEqual` to compare these, which returns `false` when comparing a string (e.g.,
'Component 1') with an object (e.g., `{name: 'Component 1', id: 'component1'}`). This
type mismatch prevents correct item selection matching, causing all dropdown items to
appear as unselected, leading to visual duplicates and a broken selection UI. A related
test in `Header.test.tsx` will also fail as it expects to find the component's `id`.

Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 3339232

@sentry
Copy link

sentry bot commented Nov 25, 2025

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
5716 2 5714 3
View the top 2 failed test(s) by shortest run time
src/pages/RepoPage/CoverageTab/ComponentsTab/Header/Header.test.tsx > Header > Show by > MultiSelect > on page load > updates the location params on select
Stack Traces | 1.05s run time
TestingLibraryElementError: Unable to find an element with the text: component1. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.

Ignored nodes: comments, script, style
<body>
  <div
    aria-live="polite"
    aria-relevant="additions text"
    id="a11y-status-message"
    role="status"
    style="border: 0px; height: 1px; margin: -1px; overflow: hidden; padding: 0px; position: absolute; width: 1px;"
  />
  <div>
    <div
      class="flex flex-col justify-end"
    >
      <div
        class="grid w-2/3 divide-y divide-solid divide-ds-gray-secondary sm:w-full sm:grid-cols-2 sm:divide-x sm:divide-y-0 md:grid-cols-4"
      >
        BranchSelector
        <div
          class="flex flex-col justify-between gap-2 p-4 sm:py-0"
        >
          <h3
            class="text-sm font-semibold text-ds-gray-octonary"
          >
            Configured components
          </h3>
          <p
            class="flex flex-1 text-xl font-light text-ds-gray-octonary"
          >
            99
          </p>
          <p
            class="text-xs"
          >
            <a
              class="
  font-sans cursor-pointer

  hover:underline

  focus:ring-2
 text-ds-blue-default inline-flex items-center gap-1"
              data-cy="components"
              data-marketing="components"
              href="https://docs.codecov.com/docs/components"
              target="_blank"
            >
              Learn more
              <span
                class="text-ds-gray-quinary"
              >
                <svg
                  class="w-4 h-4"
                  data-icon=""
                  data-testid=""
                  fill="none"
                  stroke="currentColor"
                  viewBox="0 0 24 24"
                  xmlns="http://www.w3.org/2000/svg"
                >
                  <path
                    d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
                    stroke-linecap="round"
                    stroke-linejoin="round"
                    stroke-width="2"
                  />
                </svg>
              </span>
            </a>
          </p>
        </div>
        <div
          class="flex flex-col gap-2 p-4 sm:py-0"
        >
          <h3
            class="text-sm font-semibold text-ds-gray-octonary"
          >
            Historical trend
          </h3>
          <div
            class="relative"
          >
            <div>
              <button
                aria-controls="downshift-47-menu"
                aria-expanded="false"
                aria-label="Select Historical Trend"
                class="flex justify-between items-center w-full rounded bg-ds-container text-left whitespace-nowrap disabled:text-ds-gray-quaternary disabled:bg-ds-gray-primary disabled:border-ds-gray-tertiary focus:outline-1 w-full h-8 px-3 border border-ds-gray-tertiary rounded-md bg-ds-background disabled:text-ds-gray-quaternary disabled:bg-ds-gray-primary disabled:border-ds-gray-tertiary"
                data-marketing="select-historical-trend"
                id="downshift-47-toggle-button"
                tabindex="-1"
                type="button"
              >
                <span
                  class="inline-flex items-center gap-1 truncate"
                >
                  Last 3 months
                </span>
                <svg
                  class="w-6 h-6"
                  data-icon=""
                  data-testid=""
                  fill="currentColor"
                  viewBox="0 0 20 20"
                  xmlns="http://www.w3.org/2000/svg"
                >
                  <path
                    clip-rule="evenodd"
                    d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
                    fill-rule="evenodd"
                  />
                </svg>
              </button>
              <div
                class="hidden absolute inset-x-0 z-50"
              >
                <div
                  class="hidden"
                >
                  <div>
                    <label
                      class="mb-2 block font-semibold sr-only"
                      for="text-input52"
                    >
                      Search
                    </label>
                    <div
                      class="relative"
                    >
                      <div
                        class="absolute left-2 flex h-full items-center text-ds-gray-quaternary"
                      >
                        <svg
                          class="w-4 h-4"
                          data-icon="search"
                          data-testid="search"
                          fill="none"
                          stroke="currentColor"
                          viewBox="0 0 24 24"
                          xmlns="http://www.w3.org/2000/svg"
                        >
                          <path
                            d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
                            stroke-linecap="round"
                            stroke-linejoin="round"
            ...

Ignored nodes: comments, script, style
<body>
  <div
    aria-live="polite"
    aria-relevant="additions text"
    id="a11y-status-message"
    role="status"
    style="border: 0px; height: 1px; margin: -1px; overflow: hidden; padding: 0px; position: absolute; width: 1px;"
  />
  <div>
    <div
      class="flex flex-col justify-end"
    >
      <div
        class="grid w-2/3 divide-y divide-solid divide-ds-gray-secondary sm:w-full sm:grid-cols-2 sm:divide-x sm:divide-y-0 md:grid-cols-4"
      >
        BranchSelector
        <div
          class="flex flex-col justify-between gap-2 p-4 sm:py-0"
        >
          <h3
            class="text-sm font-semibold text-ds-gray-octonary"
          >
            Configured components
          </h3>
          <p
            class="flex flex-1 text-xl font-light text-ds-gray-octonary"
          >
            99
          </p>
          <p
            class="text-xs"
          >
            <a
              class="
  font-sans cursor-pointer

  hover:underline

  focus:ring-2
 text-ds-blue-default inline-flex items-center gap-1"
              data-cy="components"
              data-marketing="components"
              href="https://docs.codecov.com/docs/components"
              target="_blank"
            >
              Learn more
              <span
                class="text-ds-gray-quinary"
              >
                <svg
                  class="w-4 h-4"
                  data-icon=""
                  data-testid=""
                  fill="none"
                  stroke="currentColor"
                  viewBox="0 0 24 24"
                  xmlns="http://www.w3.org/2000/svg"
                >
                  <path
                    d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
                    stroke-linecap="round"
                    stroke-linejoin="round"
                    stroke-width="2"
                  />
                </svg>
              </span>
            </a>
          </p>
        </div>
        <div
          class="flex flex-col gap-2 p-4 sm:py-0"
        >
          <h3
            class="text-sm font-semibold text-ds-gray-octonary"
          >
            Historical trend
          </h3>
          <div
            class="relative"
          >
            <div>
              <button
                aria-controls="downshift-47-menu"
                aria-expanded="false"
                aria-label="Select Historical Trend"
                class="flex justify-between items-center w-full rounded bg-ds-container text-left whitespace-nowrap disabled:text-ds-gray-quaternary disabled:bg-ds-gray-primary disabled:border-ds-gray-tertiary focus:outline-1 w-full h-8 px-3 border border-ds-gray-tertiary rounded-md bg-ds-background disabled:text-ds-gray-quaternary disabled:bg-ds-gray-primary disabled:border-ds-gray-tertiary"
                data-marketing="select-historical-trend"
                id="downshift-47-toggle-button"
                tabindex="-1"
                type="button"
              >
                <span
                  class="inline-flex items-center gap-1 truncate"
                >
                  Last 3 months
                </span>
                <svg
                  class="w-6 h-6"
                  data-icon=""
                  data-testid=""
                  fill="currentColor"
                  viewBox="0 0 20 20"
                  xmlns="http://www.w3.org/2000/svg"
                >
                  <path
                    clip-rule="evenodd"
                    d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
                    fill-rule="evenodd"
                  />
                </svg>
              </button>
              <div
                class="hidden absolute inset-x-0 z-50"
              >
                <div
                  class="hidden"
                >
                  <div>
                    <label
                      class="mb-2 block font-semibold sr-only"
                      for="text-input52"
                    >
                      Search
                    </label>
                    <div
                      class="relative"
                    >
                      <div
                        class="absolute left-2 flex h-full items-center text-ds-gray-quaternary"
                      >
                        <svg
                          class="w-4 h-4"
                          data-icon="search"
                          data-testid="search"
                          fill="none"
                          stroke="currentColor"
                          viewBox="0 0 24 24"
                          xmlns="http://www.w3.org/2000/svg"
                        >
                          <path
                            d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
                            stroke-linecap="round"
                            stroke-linejoin="round"
            ...
 ❯ waitForWrapper node_modules/@.../dom/dist/wait-for.js:163:27
 ❯ node_modules/@.../dom/dist/query-helpers.js:86:33
 ❯ .../ComponentsTab/Header/Header.test.tsx:214:43
src/pages/RepoPage/CoverageTab/ComponentsTab/Header/Header.test.tsx > Header > Show by > MultiSelect > on page load > loads the expected list
Stack Traces | 1.06s run time
TestingLibraryElementError: Unable to find an element with the text: component1. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.

Ignored nodes: comments, script, style
<body>
  <div>
    <div
      class="flex flex-col justify-end"
    >
      <div
        class="grid w-2/3 divide-y divide-solid divide-ds-gray-secondary sm:w-full sm:grid-cols-2 sm:divide-x sm:divide-y-0 md:grid-cols-4"
      >
        BranchSelector
        <div
          class="flex flex-col justify-between gap-2 p-4 sm:py-0"
        >
          <h3
            class="text-sm font-semibold text-ds-gray-octonary"
          >
            Configured components
          </h3>
          <p
            class="flex flex-1 text-xl font-light text-ds-gray-octonary"
          >
            99
          </p>
          <p
            class="text-xs"
          >
            <a
              class="
  font-sans cursor-pointer

  hover:underline

  focus:ring-2
 text-ds-blue-default inline-flex items-center gap-1"
              data-cy="components"
              data-marketing="components"
              href="https://docs.codecov.com/docs/components"
              target="_blank"
            >
              Learn more
              <span
                class="text-ds-gray-quinary"
              >
                <svg
                  class="w-4 h-4"
                  data-icon=""
                  data-testid=""
                  fill="none"
                  stroke="currentColor"
                  viewBox="0 0 24 24"
                  xmlns="http://www.w3.org/2000/svg"
                >
                  <path
                    d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
                    stroke-linecap="round"
                    stroke-linejoin="round"
                    stroke-width="2"
                  />
                </svg>
              </span>
            </a>
          </p>
        </div>
        <div
          class="flex flex-col gap-2 p-4 sm:py-0"
        >
          <h3
            class="text-sm font-semibold text-ds-gray-octonary"
          >
            Historical trend
          </h3>
          <div
            class="relative"
          >
            <div>
              <button
                aria-controls="downshift-40-menu"
                aria-expanded="false"
                aria-label="Select Historical Trend"
                class="flex justify-between items-center w-full rounded bg-ds-container text-left whitespace-nowrap disabled:text-ds-gray-quaternary disabled:bg-ds-gray-primary disabled:border-ds-gray-tertiary focus:outline-1 w-full h-8 px-3 border border-ds-gray-tertiary rounded-md bg-ds-background disabled:text-ds-gray-quaternary disabled:bg-ds-gray-primary disabled:border-ds-gray-tertiary"
                data-marketing="select-historical-trend"
                id="downshift-40-toggle-button"
                tabindex="-1"
                type="button"
              >
                <span
                  class="inline-flex items-center gap-1 truncate"
                >
                  Last 3 months
                </span>
                <svg
                  class="w-6 h-6"
                  data-icon=""
                  data-testid=""
                  fill="currentColor"
                  viewBox="0 0 20 20"
                  xmlns="http://www.w3.org/2000/svg"
                >
                  <path
                    clip-rule="evenodd"
                    d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
                    fill-rule="evenodd"
                  />
                </svg>
              </button>
              <div
                class="hidden absolute inset-x-0 z-50"
              >
                <div
                  class="hidden"
                >
                  <div>
                    <label
                      class="mb-2 block font-semibold sr-only"
                      for="text-input45"
                    >
                      Search
                    </label>
                    <div
                      class="relative"
                    >
                      <div
                        class="absolute left-2 flex h-full items-center text-ds-gray-quaternary"
                      >
                        <svg
                          class="w-4 h-4"
                          data-icon="search"
                          data-testid="search"
                          fill="none"
                          stroke="currentColor"
                          viewBox="0 0 24 24"
                          xmlns="http://www.w3.org/2000/svg"
                        >
                          <path
                            d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
                            stroke-linecap="round"
                            stroke-linejoin="round"
                            stroke-width="2"
                          />
                        </svg>
                      </div>
                      <input
                        aria-activedescendant=""
                        aria-autocomplete="list"
    ...

Ignored nodes: comments, script, style
<body>
  <div>
    <div
      class="flex flex-col justify-end"
    >
      <div
        class="grid w-2/3 divide-y divide-solid divide-ds-gray-secondary sm:w-full sm:grid-cols-2 sm:divide-x sm:divide-y-0 md:grid-cols-4"
      >
        BranchSelector
        <div
          class="flex flex-col justify-between gap-2 p-4 sm:py-0"
        >
          <h3
            class="text-sm font-semibold text-ds-gray-octonary"
          >
            Configured components
          </h3>
          <p
            class="flex flex-1 text-xl font-light text-ds-gray-octonary"
          >
            99
          </p>
          <p
            class="text-xs"
          >
            <a
              class="
  font-sans cursor-pointer

  hover:underline

  focus:ring-2
 text-ds-blue-default inline-flex items-center gap-1"
              data-cy="components"
              data-marketing="components"
              href="https://docs.codecov.com/docs/components"
              target="_blank"
            >
              Learn more
              <span
                class="text-ds-gray-quinary"
              >
                <svg
                  class="w-4 h-4"
                  data-icon=""
                  data-testid=""
                  fill="none"
                  stroke="currentColor"
                  viewBox="0 0 24 24"
                  xmlns="http://www.w3.org/2000/svg"
                >
                  <path
                    d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
                    stroke-linecap="round"
                    stroke-linejoin="round"
                    stroke-width="2"
                  />
                </svg>
              </span>
            </a>
          </p>
        </div>
        <div
          class="flex flex-col gap-2 p-4 sm:py-0"
        >
          <h3
            class="text-sm font-semibold text-ds-gray-octonary"
          >
            Historical trend
          </h3>
          <div
            class="relative"
          >
            <div>
              <button
                aria-controls="downshift-40-menu"
                aria-expanded="false"
                aria-label="Select Historical Trend"
                class="flex justify-between items-center w-full rounded bg-ds-container text-left whitespace-nowrap disabled:text-ds-gray-quaternary disabled:bg-ds-gray-primary disabled:border-ds-gray-tertiary focus:outline-1 w-full h-8 px-3 border border-ds-gray-tertiary rounded-md bg-ds-background disabled:text-ds-gray-quaternary disabled:bg-ds-gray-primary disabled:border-ds-gray-tertiary"
                data-marketing="select-historical-trend"
                id="downshift-40-toggle-button"
                tabindex="-1"
                type="button"
              >
                <span
                  class="inline-flex items-center gap-1 truncate"
                >
                  Last 3 months
                </span>
                <svg
                  class="w-6 h-6"
                  data-icon=""
                  data-testid=""
                  fill="currentColor"
                  viewBox="0 0 20 20"
                  xmlns="http://www.w3.org/2000/svg"
                >
                  <path
                    clip-rule="evenodd"
                    d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
                    fill-rule="evenodd"
                  />
                </svg>
              </button>
              <div
                class="hidden absolute inset-x-0 z-50"
              >
                <div
                  class="hidden"
                >
                  <div>
                    <label
                      class="mb-2 block font-semibold sr-only"
                      for="text-input45"
                    >
                      Search
                    </label>
                    <div
                      class="relative"
                    >
                      <div
                        class="absolute left-2 flex h-full items-center text-ds-gray-quaternary"
                      >
                        <svg
                          class="w-4 h-4"
                          data-icon="search"
                          data-testid="search"
                          fill="none"
                          stroke="currentColor"
                          viewBox="0 0 24 24"
                          xmlns="http://www.w3.org/2000/svg"
                        >
                          <path
                            d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
                            stroke-linecap="round"
                            stroke-linejoin="round"
                            stroke-width="2"
                          />
                        </svg>
                      </div>
                      <input
                        aria-activedescendant=""
                        aria-autocomplete="list"
    ...
 ❯ waitForWrapper node_modules/@.../dom/dist/wait-for.js:163:27
 ❯ node_modules/@.../dom/dist/query-helpers.js:86:33
 ❯ .../ComponentsTab/Header/Header.test.tsx:203:43

To view more test analytics, go to the Prevent Tests Dashboard

@codecov-public-qa
Copy link

codecov-public-qa bot commented Nov 25, 2025

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
5716 2 5714 3
View the top 2 failed test(s) by shortest run time
src/pages/RepoPage/CoverageTab/ComponentsTab/Header/Header.test.tsx > Header > Show by > MultiSelect > on page load > updates the location params on select
Stack Traces | 1.05s run time
TestingLibraryElementError: Unable to find an element with the text: component1. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.

Ignored nodes: comments, script, style
<body>
  <div
    aria-live="polite"
    aria-relevant="additions text"
    id="a11y-status-message"
    role="status"
    style="border: 0px; height: 1px; margin: -1px; overflow: hidden; padding: 0px; position: absolute; width: 1px;"
  />
  <div>
    <div
      class="flex flex-col justify-end"
    >
      <div
        class="grid w-2/3 divide-y divide-solid divide-ds-gray-secondary sm:w-full sm:grid-cols-2 sm:divide-x sm:divide-y-0 md:grid-cols-4"
      >
        BranchSelector
        <div
          class="flex flex-col justify-between gap-2 p-4 sm:py-0"
        >
          <h3
            class="text-sm font-semibold text-ds-gray-octonary"
          >
            Configured components
          </h3>
          <p
            class="flex flex-1 text-xl font-light text-ds-gray-octonary"
          >
            99
          </p>
          <p
            class="text-xs"
          >
            <a
              class="
  font-sans cursor-pointer

  hover:underline

  focus:ring-2
 text-ds-blue-default inline-flex items-center gap-1"
              data-cy="components"
              data-marketing="components"
              href="https://docs.codecov.com/docs/components"
              target="_blank"
            >
              Learn more
              <span
                class="text-ds-gray-quinary"
              >
                <svg
                  class="w-4 h-4"
                  data-icon=""
                  data-testid=""
                  fill="none"
                  stroke="currentColor"
                  viewBox="0 0 24 24"
                  xmlns="http://www.w3.org/2000/svg"
                >
                  <path
                    d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
                    stroke-linecap="round"
                    stroke-linejoin="round"
                    stroke-width="2"
                  />
                </svg>
              </span>
            </a>
          </p>
        </div>
        <div
          class="flex flex-col gap-2 p-4 sm:py-0"
        >
          <h3
            class="text-sm font-semibold text-ds-gray-octonary"
          >
            Historical trend
          </h3>
          <div
            class="relative"
          >
            <div>
              <button
                aria-controls="downshift-47-menu"
                aria-expanded="false"
                aria-label="Select Historical Trend"
                class="flex justify-between items-center w-full rounded bg-ds-container text-left whitespace-nowrap disabled:text-ds-gray-quaternary disabled:bg-ds-gray-primary disabled:border-ds-gray-tertiary focus:outline-1 w-full h-8 px-3 border border-ds-gray-tertiary rounded-md bg-ds-background disabled:text-ds-gray-quaternary disabled:bg-ds-gray-primary disabled:border-ds-gray-tertiary"
                data-marketing="select-historical-trend"
                id="downshift-47-toggle-button"
                tabindex="-1"
                type="button"
              >
                <span
                  class="inline-flex items-center gap-1 truncate"
                >
                  Last 3 months
                </span>
                <svg
                  class="w-6 h-6"
                  data-icon=""
                  data-testid=""
                  fill="currentColor"
                  viewBox="0 0 20 20"
                  xmlns="http://www.w3.org/2000/svg"
                >
                  <path
                    clip-rule="evenodd"
                    d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
                    fill-rule="evenodd"
                  />
                </svg>
              </button>
              <div
                class="hidden absolute inset-x-0 z-50"
              >
                <div
                  class="hidden"
                >
                  <div>
                    <label
                      class="mb-2 block font-semibold sr-only"
                      for="text-input52"
                    >
                      Search
                    </label>
                    <div
                      class="relative"
                    >
                      <div
                        class="absolute left-2 flex h-full items-center text-ds-gray-quaternary"
                      >
                        <svg
                          class="w-4 h-4"
                          data-icon="search"
                          data-testid="search"
                          fill="none"
                          stroke="currentColor"
                          viewBox="0 0 24 24"
                          xmlns="http://www.w3.org/2000/svg"
                        >
                          <path
                            d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
                            stroke-linecap="round"
                            stroke-linejoin="round"
            ...

Ignored nodes: comments, script, style
<body>
  <div
    aria-live="polite"
    aria-relevant="additions text"
    id="a11y-status-message"
    role="status"
    style="border: 0px; height: 1px; margin: -1px; overflow: hidden; padding: 0px; position: absolute; width: 1px;"
  />
  <div>
    <div
      class="flex flex-col justify-end"
    >
      <div
        class="grid w-2/3 divide-y divide-solid divide-ds-gray-secondary sm:w-full sm:grid-cols-2 sm:divide-x sm:divide-y-0 md:grid-cols-4"
      >
        BranchSelector
        <div
          class="flex flex-col justify-between gap-2 p-4 sm:py-0"
        >
          <h3
            class="text-sm font-semibold text-ds-gray-octonary"
          >
            Configured components
          </h3>
          <p
            class="flex flex-1 text-xl font-light text-ds-gray-octonary"
          >
            99
          </p>
          <p
            class="text-xs"
          >
            <a
              class="
  font-sans cursor-pointer

  hover:underline

  focus:ring-2
 text-ds-blue-default inline-flex items-center gap-1"
              data-cy="components"
              data-marketing="components"
              href="https://docs.codecov.com/docs/components"
              target="_blank"
            >
              Learn more
              <span
                class="text-ds-gray-quinary"
              >
                <svg
                  class="w-4 h-4"
                  data-icon=""
                  data-testid=""
                  fill="none"
                  stroke="currentColor"
                  viewBox="0 0 24 24"
                  xmlns="http://www.w3.org/2000/svg"
                >
                  <path
                    d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
                    stroke-linecap="round"
                    stroke-linejoin="round"
                    stroke-width="2"
                  />
                </svg>
              </span>
            </a>
          </p>
        </div>
        <div
          class="flex flex-col gap-2 p-4 sm:py-0"
        >
          <h3
            class="text-sm font-semibold text-ds-gray-octonary"
          >
            Historical trend
          </h3>
          <div
            class="relative"
          >
            <div>
              <button
                aria-controls="downshift-47-menu"
                aria-expanded="false"
                aria-label="Select Historical Trend"
                class="flex justify-between items-center w-full rounded bg-ds-container text-left whitespace-nowrap disabled:text-ds-gray-quaternary disabled:bg-ds-gray-primary disabled:border-ds-gray-tertiary focus:outline-1 w-full h-8 px-3 border border-ds-gray-tertiary rounded-md bg-ds-background disabled:text-ds-gray-quaternary disabled:bg-ds-gray-primary disabled:border-ds-gray-tertiary"
                data-marketing="select-historical-trend"
                id="downshift-47-toggle-button"
                tabindex="-1"
                type="button"
              >
                <span
                  class="inline-flex items-center gap-1 truncate"
                >
                  Last 3 months
                </span>
                <svg
                  class="w-6 h-6"
                  data-icon=""
                  data-testid=""
                  fill="currentColor"
                  viewBox="0 0 20 20"
                  xmlns="http://www.w3.org/2000/svg"
                >
                  <path
                    clip-rule="evenodd"
                    d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
                    fill-rule="evenodd"
                  />
                </svg>
              </button>
              <div
                class="hidden absolute inset-x-0 z-50"
              >
                <div
                  class="hidden"
                >
                  <div>
                    <label
                      class="mb-2 block font-semibold sr-only"
                      for="text-input52"
                    >
                      Search
                    </label>
                    <div
                      class="relative"
                    >
                      <div
                        class="absolute left-2 flex h-full items-center text-ds-gray-quaternary"
                      >
                        <svg
                          class="w-4 h-4"
                          data-icon="search"
                          data-testid="search"
                          fill="none"
                          stroke="currentColor"
                          viewBox="0 0 24 24"
                          xmlns="http://www.w3.org/2000/svg"
                        >
                          <path
                            d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
                            stroke-linecap="round"
                            stroke-linejoin="round"
            ...
 ❯ waitForWrapper node_modules/@.../dom/dist/wait-for.js:163:27node_modules/@.../dom/dist/query-helpers.js:86:33
 ❯ .../ComponentsTab/Header/Header.test.tsx:214:43
src/pages/RepoPage/CoverageTab/ComponentsTab/Header/Header.test.tsx > Header > Show by > MultiSelect > on page load > loads the expected list
Stack Traces | 1.06s run time
TestingLibraryElementError: Unable to find an element with the text: component1. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.

Ignored nodes: comments, script, style
<body>
  <div>
    <div
      class="flex flex-col justify-end"
    >
      <div
        class="grid w-2/3 divide-y divide-solid divide-ds-gray-secondary sm:w-full sm:grid-cols-2 sm:divide-x sm:divide-y-0 md:grid-cols-4"
      >
        BranchSelector
        <div
          class="flex flex-col justify-between gap-2 p-4 sm:py-0"
        >
          <h3
            class="text-sm font-semibold text-ds-gray-octonary"
          >
            Configured components
          </h3>
          <p
            class="flex flex-1 text-xl font-light text-ds-gray-octonary"
          >
            99
          </p>
          <p
            class="text-xs"
          >
            <a
              class="
  font-sans cursor-pointer

  hover:underline

  focus:ring-2
 text-ds-blue-default inline-flex items-center gap-1"
              data-cy="components"
              data-marketing="components"
              href="https://docs.codecov.com/docs/components"
              target="_blank"
            >
              Learn more
              <span
                class="text-ds-gray-quinary"
              >
                <svg
                  class="w-4 h-4"
                  data-icon=""
                  data-testid=""
                  fill="none"
                  stroke="currentColor"
                  viewBox="0 0 24 24"
                  xmlns="http://www.w3.org/2000/svg"
                >
                  <path
                    d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
                    stroke-linecap="round"
                    stroke-linejoin="round"
                    stroke-width="2"
                  />
                </svg>
              </span>
            </a>
          </p>
        </div>
        <div
          class="flex flex-col gap-2 p-4 sm:py-0"
        >
          <h3
            class="text-sm font-semibold text-ds-gray-octonary"
          >
            Historical trend
          </h3>
          <div
            class="relative"
          >
            <div>
              <button
                aria-controls="downshift-40-menu"
                aria-expanded="false"
                aria-label="Select Historical Trend"
                class="flex justify-between items-center w-full rounded bg-ds-container text-left whitespace-nowrap disabled:text-ds-gray-quaternary disabled:bg-ds-gray-primary disabled:border-ds-gray-tertiary focus:outline-1 w-full h-8 px-3 border border-ds-gray-tertiary rounded-md bg-ds-background disabled:text-ds-gray-quaternary disabled:bg-ds-gray-primary disabled:border-ds-gray-tertiary"
                data-marketing="select-historical-trend"
                id="downshift-40-toggle-button"
                tabindex="-1"
                type="button"
              >
                <span
                  class="inline-flex items-center gap-1 truncate"
                >
                  Last 3 months
                </span>
                <svg
                  class="w-6 h-6"
                  data-icon=""
                  data-testid=""
                  fill="currentColor"
                  viewBox="0 0 20 20"
                  xmlns="http://www.w3.org/2000/svg"
                >
                  <path
                    clip-rule="evenodd"
                    d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
                    fill-rule="evenodd"
                  />
                </svg>
              </button>
              <div
                class="hidden absolute inset-x-0 z-50"
              >
                <div
                  class="hidden"
                >
                  <div>
                    <label
                      class="mb-2 block font-semibold sr-only"
                      for="text-input45"
                    >
                      Search
                    </label>
                    <div
                      class="relative"
                    >
                      <div
                        class="absolute left-2 flex h-full items-center text-ds-gray-quaternary"
                      >
                        <svg
                          class="w-4 h-4"
                          data-icon="search"
                          data-testid="search"
                          fill="none"
                          stroke="currentColor"
                          viewBox="0 0 24 24"
                          xmlns="http://www.w3.org/2000/svg"
                        >
                          <path
                            d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
                            stroke-linecap="round"
                            stroke-linejoin="round"
                            stroke-width="2"
                          />
                        </svg>
                      </div>
                      <input
                        aria-activedescendant=""
                        aria-autocomplete="list"
    ...

Ignored nodes: comments, script, style
<body>
  <div>
    <div
      class="flex flex-col justify-end"
    >
      <div
        class="grid w-2/3 divide-y divide-solid divide-ds-gray-secondary sm:w-full sm:grid-cols-2 sm:divide-x sm:divide-y-0 md:grid-cols-4"
      >
        BranchSelector
        <div
          class="flex flex-col justify-between gap-2 p-4 sm:py-0"
        >
          <h3
            class="text-sm font-semibold text-ds-gray-octonary"
          >
            Configured components
          </h3>
          <p
            class="flex flex-1 text-xl font-light text-ds-gray-octonary"
          >
            99
          </p>
          <p
            class="text-xs"
          >
            <a
              class="
  font-sans cursor-pointer

  hover:underline

  focus:ring-2
 text-ds-blue-default inline-flex items-center gap-1"
              data-cy="components"
              data-marketing="components"
              href="https://docs.codecov.com/docs/components"
              target="_blank"
            >
              Learn more
              <span
                class="text-ds-gray-quinary"
              >
                <svg
                  class="w-4 h-4"
                  data-icon=""
                  data-testid=""
                  fill="none"
                  stroke="currentColor"
                  viewBox="0 0 24 24"
                  xmlns="http://www.w3.org/2000/svg"
                >
                  <path
                    d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
                    stroke-linecap="round"
                    stroke-linejoin="round"
                    stroke-width="2"
                  />
                </svg>
              </span>
            </a>
          </p>
        </div>
        <div
          class="flex flex-col gap-2 p-4 sm:py-0"
        >
          <h3
            class="text-sm font-semibold text-ds-gray-octonary"
          >
            Historical trend
          </h3>
          <div
            class="relative"
          >
            <div>
              <button
                aria-controls="downshift-40-menu"
                aria-expanded="false"
                aria-label="Select Historical Trend"
                class="flex justify-between items-center w-full rounded bg-ds-container text-left whitespace-nowrap disabled:text-ds-gray-quaternary disabled:bg-ds-gray-primary disabled:border-ds-gray-tertiary focus:outline-1 w-full h-8 px-3 border border-ds-gray-tertiary rounded-md bg-ds-background disabled:text-ds-gray-quaternary disabled:bg-ds-gray-primary disabled:border-ds-gray-tertiary"
                data-marketing="select-historical-trend"
                id="downshift-40-toggle-button"
                tabindex="-1"
                type="button"
              >
                <span
                  class="inline-flex items-center gap-1 truncate"
                >
                  Last 3 months
                </span>
                <svg
                  class="w-6 h-6"
                  data-icon=""
                  data-testid=""
                  fill="currentColor"
                  viewBox="0 0 20 20"
                  xmlns="http://www.w3.org/2000/svg"
                >
                  <path
                    clip-rule="evenodd"
                    d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
                    fill-rule="evenodd"
                  />
                </svg>
              </button>
              <div
                class="hidden absolute inset-x-0 z-50"
              >
                <div
                  class="hidden"
                >
                  <div>
                    <label
                      class="mb-2 block font-semibold sr-only"
                      for="text-input45"
                    >
                      Search
                    </label>
                    <div
                      class="relative"
                    >
                      <div
                        class="absolute left-2 flex h-full items-center text-ds-gray-quaternary"
                      >
                        <svg
                          class="w-4 h-4"
                          data-icon="search"
                          data-testid="search"
                          fill="none"
                          stroke="currentColor"
                          viewBox="0 0 24 24"
                          xmlns="http://www.w3.org/2000/svg"
                        >
                          <path
                            d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
                            stroke-linecap="round"
                            stroke-linejoin="round"
                            stroke-width="2"
                          />
                        </svg>
                      </div>
                      <input
                        aria-activedescendant=""
                        aria-autocomplete="list"
    ...
 ❯ waitForWrapper node_modules/@.../dom/dist/wait-for.js:163:27node_modules/@.../dom/dist/query-helpers.js:86:33
 ❯ .../ComponentsTab/Header/Header.test.tsx:203:43

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.


const componentNames = componentsData?.components?.map(
(component) => component?.id
(component) => component?.name
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Component filter uses names instead of IDs for API

The change from component?.id to component?.name updates what's displayed in the dropdown, but the selected values are also used for API filtering via updateParams({ components }). The selected names flow to useRepoComponentsTable where they're passed as filters: { components: params?.components } to useRepoComponents. Test data shows id and name are distinct values (e.g., { name: 'foo', id: '1' }). If the GraphQL ComponentMeasurementsSetFilters expects component IDs for filtering, passing names will break the filter functionality. The dropdown needs to display names while still passing IDs for filtering.

Fix in Cursor Fix in Web

@codecov-releaser
Copy link
Contributor

✅ Deploy preview for gazebo ready!

Previews expire after 1 month automatically.

Storybook

Commit Created Cloud Enterprise
61cca7a Tue, 25 Nov 2025 01:02:49 GMT Cloud Enterprise

@sentry
Copy link

sentry bot commented Nov 25, 2025

Bundle Report

Changes will increase total bundle size by 4 bytes (0.0%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
gazebo-production-system 6.23MB 2 bytes (0.0%) ⬆️
gazebo-production-esm 6.32MB 2 bytes (0.0%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: gazebo-production-system

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index-legacy.*.js 2 bytes 84.77kB 0.0%

Files in assets/index-legacy.*.js:

  • ./src/pages/RepoPage/CoverageTab/ComponentsTab/Header/Header.tsx → Total Size: 4.17kB
view changes for bundle: gazebo-production-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index.*.js 2 bytes 90.03kB 0.0%

Files in assets/index.*.js:

  • ./src/pages/RepoPage/CoverageTab/ComponentsTab/Header/Header.tsx → Total Size: 4.17kB

@calvin-codecov calvin-codecov marked this pull request as draft November 26, 2025 00:14
@calvin-codecov calvin-codecov marked this pull request as draft November 26, 2025 00:14
@calvin-codecov calvin-codecov marked this pull request as draft November 26, 2025 00:14
@calvin-codecov calvin-codecov marked this pull request as draft November 26, 2025 00:14
@calvin-codecov calvin-codecov marked this pull request as draft November 26, 2025 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants