Skip to content

Add test coverage for publications#614

Open
marqode wants to merge 15 commits into
mainfrom
fix/publication-test-coverage
Open

Add test coverage for publications#614
marqode wants to merge 15 commits into
mainfrom
fix/publication-test-coverage

Conversation

@marqode
Copy link
Copy Markdown
Contributor

@marqode marqode commented May 11, 2026

Summary

  • Improve test coverage of /publications and /mirrors
  • Fix intermittently failing publications test: MSW DELETE/PATCH handlers mutated shared mock array across tests; fix copies array locally and resets in afterEach. PublicationsContainer test corrected to wait for settled empty state and assert button count instead of absence, fixing race with two sequential loading spinners.

Release Impact

Pick the target branch (see RELEASES.md for the full model):

  • dev — internal testing → publishes to ppa-build-dev
  • main — next beta → publishes to ppa-build
  • release/YY.MM — point release on a maintained cycle → publishes to ppa-build-YY.MM (and to ppa-build-stable if this is the currently-promoted branch). Specify cycle: release/____

Change type (tick one):

  • Patch (fix)
  • Minor (feature)
  • Major (breaking)

The change-type label is informational and only affects how the entry is rendered in the CHANGELOG. The actual version is computed from the branch and CalVer cycle — pnpm changeset's patch/minor choice does not influence it.

Checklist

  • Changeset added — I have run pnpm changeset (or pnpm changeset --empty if no CHANGELOG line is warranted) and committed the resulting .md file. Required for PRs targeting main and release/*; enforced by the Changeset check workflow.
  • UI verified — I have verified the changes locally.
  • Linting clean — No linting errors are present (especially in scripts/).

Versioning Reminder

Important

Landscape UI uses CalVer (YY.MM.Point.Build). Version derivation by branch:

  • main / point/*YY.MM.0.<run>-beta
  • devYY.MM.0.<run>-dev
  • release/YY.MMYY.MM.1.<run> (cycle pinned by branch name)

yurii-vasyliev and others added 5 commits May 7, 2026 18:35
Open the dropdown on focus (not just mouse click), expose aria-expanded /
aria-controls / aria-activedescendant on the input, label the panel as a
group, restore focus to the input on Escape, and let users navigate the
list with ↑/↓/Home/End and apply with Enter. Active item scrolls into
view, and a muted helper hint describes the shortcuts.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR increases test coverage around the publications feature area, and also introduces two user-facing improvements: keyboard navigation for the saved-searches dropdown and multi-select architecture selection in the “Add publication” form.

Changes:

  • Add/expand publications-related component tests (header search param update, filtering behavior, empty state navigation, details side panel).
  • Improve saved-searches dropdown keyboard accessibility (arrow-key navigation, ARIA wiring, focus/blur behavior) and add extensive tests.
  • Update publication creation to support selecting multiple architectures (form + validation + tests), with changesets for both user-facing updates.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/tests/setup.ts Adds a scrollIntoView no-op polyfill for jsdom-based tests.
src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx Adds focus management, keyboard navigation, and ARIA attributes for the saved-searches dropdown.
src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.test.tsx Adds keyboard accessibility test coverage for the saved-searches dropdown behavior.
src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.module.scss Styles keyboard shortcut hint and <kbd> presentation.
src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx Adds active-item highlighting and scroll-into-view behavior for aria-activedescendant navigation.
src/features/saved-searches/components/SavedSearchList/SavedSearchList.module.scss Adds styling for the active (highlighted) item.
src/features/publications/components/PublicationsHeader/PublicationsHeader.test.tsx Tests that submitting search updates the URL query param.
src/features/publications/components/PublicationsContainer/PublicationsContainer.test.tsx Adds filtering tests for different query syntaxes (prefix vs plain text).
src/features/publications/components/PublicationDetailsSidePanel/PublicationDetailsSidePanel.test.tsx Adds loading and loaded-state coverage for the details side panel.
src/features/publications/components/NoPublicationsTargetEmptyState/NoPublicationTargetEmptyState.test.tsx Tests CTA navigation to the “add publication target” route.
src/features/publications/components/AddPublicationForm/types.ts Changes uploader_architectures to a string[].
src/features/publications/components/AddPublicationForm/helpers.ts Updates Yup validation and payload generation for architecture arrays.
src/features/publications/components/AddPublicationForm/constants.ts Updates initial values for architecture arrays.
src/features/publications/components/AddPublicationForm/AddPublicationForm.tsx Replaces single-select architectures with MultiSelectField and updates form state handling.
src/features/publications/components/AddPublicationForm/AddPublicationForm.test.tsx Updates tests for MultiSelect architectures + adds validation/submission coverage.
src/features/mirrors/components/MirrorDetails/MirrorDetails.test.tsx Expands assertions, but currently includes a duplicated test case.
.changeset/twelve-suns-sing.md Changeset for saved-searches keyboard navigation enhancement.
.changeset/light-corners-lick.md Changeset for multi-architecture selection in publication creation.
Comments suppressed due to low confidence (1)

src/features/mirrors/components/MirrorDetails/MirrorDetails.test.tsx:51

  • This file contains two identical test cases named "displays preserve signatures status" with the same assertions. Keeping both adds redundant runtime and makes future failures harder to interpret; consider removing one or changing the second to cover the opposite value (e.g. preserveSignatures=false => "No").
  it("displays preserve signatures status", async () => {
    const mirrorWithPreserveSignatures = mirrors.find(
      ({ preserveSignatures }) => preserveSignatures,
    );

Comment on lines +1 to +5
---
"landscape-ui": patch
---

Keyboard a11y and arrow-key navigation for saved-searches dropdown
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.

Comments suppressed due to low confidence (1)

src/features/mirrors/components/MirrorDetails/MirrorDetails.test.tsx:45

  • This test renders mirrorWithPreserveSignatures (the first mock with preserveSignatures=true), but then asserts the heading for mirrors[0].displayName. With the current mocks, mirrorWithPreserveSignatures is mirrors[1], so this assertion will fail. Assert against mirrorWithPreserveSignatures.displayName instead.
  it("displays preserve signatures status", async () => {
    const mirrorWithPreserveSignatures = mirrors.find(
      ({ preserveSignatures }) => preserveSignatures,
    );

    assert(mirrorWithPreserveSignatures);

    renderWithProviders(
      <Suspense fallback={<LoadingState />}>
        <MirrorDetails />
      </Suspense>,
      undefined,
      `?name=${mirrorWithPreserveSignatures.name}`,
    );

    await expectLoadingState();

    expect(
      screen.getByRole("heading", { name: mirrors[0].displayName }),
    ).toBeInTheDocument();

Comment thread src/features/mirrors/components/MirrorDetails/MirrorDetails.test.tsx Outdated
Comment thread src/features/mirrors/components/MirrorDetails/MirrorDetails.test.tsx Outdated
Comment on lines +1 to +5
---
"landscape-ui": patch
---

Allow selection of more than one architecture when creating a publication
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@gesquivelgaghi
Copy link
Copy Markdown
Contributor

We should improve coverage for some mirror components too, do you think we can add it to this PR or should we do it separately?
image

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.

Comment on lines +112 to +116
it("handles batchGet response with no mirrors array and nameless mirrors", async () => {
server.use(
http.post(`${API_URL_DEB_ARCHIVE}mirrors:batchGet`, () =>
HttpResponse.json({ mirrors: [{ displayName: "no-name-mirror" }] }),
),
Comment thread src/features/mirrors/components/MirrorDetails/MirrorDetails.test.tsx Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

TICS Quality Gate

❌ Failed

landscape-ui

Coding Standards: ❌ 196 Blocking Issues

❌ Condition “No new Coding Standard Violations for level 1, 2, 3 with respect to Previous analysis” failed 1 time.
FileIssues
🪲 Total❌ Blocking

src/features/publications/components/AddPublicationForm/AddPublicationForm.tsx

196+196

See the results in the TICS Viewer

The following files have been checked for this project
  • src/features/publications/components/AddPublicationForm/AddPublicationForm.tsx

Run-tests-and-TICS-report / tics-report / TICS report

@marqode marqode requested a review from a team May 12, 2026 22:03
@marqode
Copy link
Copy Markdown
Contributor Author

marqode commented May 12, 2026

@gesquivelgaghi good call. Added tests to bring /mirrors coverage up to 92%

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.

4 participants