Skip to content

Refactor nav config tests to use name-based group lookups#7363

Merged
gilluminate merged 5 commits intomainfrom
gill/fix-nav-tests
Feb 17, 2026
Merged

Refactor nav config tests to use name-based group lookups#7363
gilluminate merged 5 commits intomainfrom
gill/fix-nav-tests

Conversation

@gilluminate
Copy link
Copy Markdown
Contributor

@gilluminate gilluminate commented Feb 11, 2026

Ticket

Description Of Changes

Refactor nav-config.test.ts to replace brittle index-based nav group assertions (navGroups[0], navGroups[1], etc.) with name-based lookups using .find(). Add a findGroup test helper that locates groups by title and asserts existence, providing clear failure messages if a group is ever missing.

Also update the "configure by feature flags" tests to test a real feature flag (previously they were asserting a feature flag that got removed and since then have really been testing nothing!).

Code Changes

  • Add typed findGroup helper that asserts group existence and returns non-nullable result
  • Replace all index-based nav group access (navGroups[N]) with findGroup or .find() by title
  • Update feature flag tests to focus on the Detection & Discovery group and dataCatalog flag instead of the now removed organizationManagement flag on Settings.
  • Add explicit toBeUndefined() assertion for groups that should not exist
  • Replace .toEqual("Domain verification") / .toEqual(undefined) with .toBeDefined() / .toBeUndefined()

Steps to Confirm

  1. Check that all 20 nav config tests pass

Pre-Merge Checklist

  • Issue requirements met
  • All CI pipelines succeeded
  • CHANGELOG.md updated
    • No UX review needed
  • Followup issues:
    • No followup issues
  • Database migrations:
    • No migrations
  • Documentation:
    • No documentation updates required

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Feb 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
fides-plus-nightly Ready Ready Preview, Comment Feb 17, 2026 5:56pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
fides-privacy-center Ignored Ignored Feb 17, 2026 5:56pm

Request Review

Co-authored-by: Cursor <cursoragent@cursor.com>
@gilluminate gilluminate requested a review from jpople February 11, 2026 21:03
@gilluminate gilluminate marked this pull request as ready for review February 11, 2026 21:03
@gilluminate gilluminate requested a review from a team as a code owner February 11, 2026 21:03
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Feb 11, 2026

Greptile Overview

Greptile Summary

Refactored nav-config.test.ts to eliminate brittle index-based nav group lookups (navGroups[0], navGroups[1], etc.) in favor of robust name-based lookups using a new typed findGroup helper function.

Key improvements:

  • Added findGroup utility that finds groups by title and asserts existence with clear error messages
  • Replaced all navGroups[N] access patterns with findGroup(navGroups, "Group Name")
  • Fixed broken feature flag tests that were asserting on the removed organizationManagement flag - now tests the actual dataCatalog flag on the Detection & Discovery group
  • Improved assertions: replaced .toEqual(undefined) with .toBeUndefined() and .toEqual("Domain verification") with .toBeDefined()
  • Added explicit test for when groups should not exist (line 97-101)

This change makes tests more resilient to nav config reordering and provides better failure messages when groups are missing.

Confidence Score: 5/5

  • This PR is safe to merge with no risk - it only refactors test code to be more maintainable
  • Score reflects a straightforward test refactoring with clear improvements: replaces brittle index-based lookups with robust name-based lookups, fixes tests that were incorrectly asserting on a removed feature flag, and improves assertion clarity. No production code changes, only test improvements
  • No files require special attention

Important Files Changed

Filename Overview
clients/admin-ui/src/features/common/nav/nav-config.test.ts Refactored tests from brittle index-based assertions to robust name-based lookups using a new findGroup helper; updated feature flag tests to use valid dataCatalog flag
changelog/fix-nav-tests.yaml Added changelog entry documenting the test refactoring as a Developer Experience improvement

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@gilluminate gilluminate added this pull request to the merge queue Feb 17, 2026
Merged via the queue into main with commit eec3856 Feb 17, 2026
45 checks passed
@gilluminate gilluminate deleted the gill/fix-nav-tests branch February 17, 2026 18:19
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.

2 participants