Cover the app-selection panel helpers - #86
Merged
Merged
Conversation
The helpers that drive the app list (scope description, selection status, search index rebuild, sort arrows, sort, and the preset check/uncheck) take live checkboxes, combo boxes, panels and text blocks but not a fully built window. Nothing exercised them outside the Sandbox smoke run. Test-GuiAppSelection.ps1 builds the controls in a per-scenario STA runspace (the pattern the schema and control-state tests already use) and drives each function: the three scope-description branches, the selection count plus scope-section show/hide and the target-user disable rule, the search index that keeps only highlighted boxes, the active-column arrow opacity, ascending and descending sort order, and additive vs exclusive preset selection. Invoke-AppPreset calls Update-AppPresetStates, which reaches the main window through FindName; the scenario overrides it with a stub so only the check/uncheck logic runs. The window-bound helpers stay in the Sandbox run.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The helpers that drive the app list take live WPF controls (checkboxes, combo boxes, panels, text blocks) but not a fully built window, so they are STA-runspace-buildable. Nothing exercised them outside the Sandbox smoke run.
Test-GuiAppSelection.ps1builds the controls in a per-scenario STA runspace (the pattern the schema and control-state tests already use) and drives each function:Update-AppRemovalScopeDescription- all three scope copiesUpdate-AppSelectionStatus- the selected count, scope-section show/hide, and the rule that keeps the scope combo disabled while target-user is selectedUpdate-AppsPanelRebuildSearchIndex- keeps only highlighted checkboxes, maps the active match to its index, skips non-checkbox childrenUpdate-SortArrows- active column full opacity, others dimmedUpdate-AppsPanelSort- ascending and descending reorderInvoke-AppPreset- additive (matches checked, others untouched) vs exclusive (non-matches unchecked)Invoke-AppPresetdelegates toUpdate-AppPresetStates, which reaches the main window throughFindName; the scenario overrides it with a stub so only the check/uncheck logic runs. The window-bound helpers (Update-AppPresetStates, the scroll helpers) stay in the Sandbox run.Test-only. New file wired into CI. Validation run locally: static validation clean (141 files), full unit suite 325 passed / 0 failed (was 312). Not run locally: the Sandbox suite (unchanged) and CI's pwsh/MTA pass, which runs on the PR.