Skip to content

LT-22691: Load the detail view in tests through one shared helper - #1264

Open
mark-sil wants to merge 1 commit into
mainfrom
LT-22691-loadrecordeditview-dedup
Open

mark-sil wants to merge 1 commit into
mainfrom
LT-22691-loadrecordeditview-dedup

Conversation

@mark-sil

@mark-sil mark-sil commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Six xWorks detail-view test fixtures now load a tool's detail view
through the shared DetailMenuTestSupport helper. Until now each kept
its own copy of the same four property-table steps, so a change to how
a tool loads could reach some fixtures and miss others.

The copies differed only in their assertion messages; the shared
helper checks the same things.

Reviewer notes

Start here: Src/xWorks/xWorksTests/Avalonia/Hosting/DetailMenuTestSupport.cs, LoadRecordEditView -- the one loader every fixture now calls.

What it does. Removes the private LoadRecordEditView from DetailObjectCommandExecutionTests, DetailWritingSystemStateTests, LexiconMenuExecutionTests, RecordClerkNavigationContextTests, RecordEditViewActiveHostContractTests and RecordEditViewSwitchTests (plus its no-argument overload, which loaded lexiconEdit). Each call site now calls DetailMenuTestSupport.LoadRecordEditView(m_propertyTable, "...") with the tool it loaded before. Test code only.

Where to look.

  • Each call site passes the tool value the removed copy loaded -- the former no-argument calls in RecordEditViewSwitchTests now pass "lexiconEdit".
  • DetailObjectCommandExecutionTests gains a null check on WindowConfiguration that its copy lacked; the other copies already had it.
  • using System.Xml; is dropped from the four fixtures that no longer use it.

Deliberately not here. The helper stays in DetailMenuTestSupport, although several of these fixtures do not test menus; its summary already names loading the detail view, and DetailViewStatePersistenceTests already called it from there.

Verification. build.ps1 -CommentHygiene -TokenHygiene clean. The six fixtures pass: 150 tests via test.ps1 -TestFilter. No manual testing: nothing a user can see changes.

Next: approve.

Preflight review details

Code Review Summary

Branch: LT-22691-loadrecordeditview-dedup
Base: origin/main (183be7c)
Date: 2026-11-25
Review model: Claude Opus 5.5
Files changed: 6

Overview

Test-only cleanup closing out LT-22691. Six xWorks Avalonia hosting fixtures each kept a
private copy of LoadRecordEditView; they now call the shared
DetailMenuTestSupport.LoadRecordEditView(propertyTable, toolValue) that the newer fixtures
already use. The copies did the same four property-table steps and differed only in
assertion text. using System.Xml; is dropped from the four fixtures that no longer need it.

Contract/API Changes

None. Test code only; no production file changes.

Findings

Critical - Must address before merge

None.

Important - Should address before merge

None.

Minor - Consider

  • RecordEditViewSwitchTests loses its descriptive message on the WindowConfiguration
    null assert
    (Mark: leave it; the failure points at the WindowConfiguration line of the
    shared helper, which is clear enough)
  • Fixtures that are not menu tests now depend on DetailMenuTestSupport (Mark: leave
    the helper where it is; its summary already names loading the detail view, and
    DetailViewStatePersistenceTests already called it)

Required Validation / Evidence

  • .\build.ps1 -CommentHygiene -TokenHygiene: succeeded, 0 warnings; comment and token
    hygiene clean.
  • .\test.ps1 -CommentHygiene -TokenHygiene -TestProject Src/xWorks/xWorksTests -TestFilter <the six fixtures>: 150 passed, 0 failed (DetailObjectCommandExecutionTests 62,
    LexiconMenuExecutionTests 70, RecordEditViewSwitchTests 12, RecordClerkNavigationContextTests
    3, DetailWritingSystemStateTests 2, RecordEditViewActiveHostContractTests 1).
  • No manual testing: test-only change. Developer-only, no new ticket needed (LT-22691 cleanup).

Positive Observations

  • One loader for every detail-view fixture, so a change to how a tool loads reaches all of them.

Interview Notes

  • Mark agreed with leaving both minor findings as they are, and chose the complete commit
    message for the top of the PR description.

Suggested Review Focus

  • Each call site passes the same tool value the removed copy loaded (lexiconEdit for
    the former no-argument overload).

🤖 Generated with Claude Code


This change is Reviewable

Six xWorks detail-view test fixtures now load a tool's detail view
through the shared DetailMenuTestSupport helper. Until now each kept
its own copy of the same four property-table steps, so a change to how
a tool loads could reach some fixtures and miss others.

The copies differed only in their assertion messages; the shared
helper checks the same things.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

NUnit Tests

    1 files  ±0      1 suites  ±0   8m 58s ⏱️ - 5m 54s
7 420 tests ±0  7 341 ✅ ±0  79 💤 ±0  0 ❌ ±0 
7 429 runs  ±0  7 350 ✅ ±0  79 💤 ±0  0 ❌ ±0 

Results for commit 2a82d1f. ± Comparison against base commit 183be7c.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 40.92%. Comparing base (183be7c) to head (2a82d1f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1264      +/-   ##
==========================================
- Coverage   40.92%   40.92%   -0.01%     
==========================================
  Files        1602     1602              
  Lines      360800   360800              
  Branches    42245    42245              
==========================================
- Hits       147648   147640       -8     
- Misses     183655   183664       +9     
+ Partials    29497    29496       -1     

see 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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