client-reliability-1: preserve native hidden-attribute behavior in style fixture

This commit is contained in:
thePR0M3TH3AN committed 2026-10-19 16:09:26 -04:00
1 parent d02240786d
commit dbdac18df1
3 files changed
+6 -2

No files matched your search

+3 -1
View File
@@ -599,7 +599,7 @@ test_integrity_note:
change_type: ["flake_fix", "new_tests"]
scenarios:
- id: SCN-profile-focus-style-contract
given: "modal controls include visible, disabled, CSS-hidden, inherited-hidden, aria-hidden, and hidden-input cases"
given: "modal controls include visible, disabled, CSS-hidden, inherited-hidden, aria-hidden, hidden-input, and hidden-attribute cases"
when: "the real controller collects focus targets using fixture and native JSDOM styles, and the user tabs from the last control"
then: "both resolvers retain only visible enabled controls and Tab wraps to the first"
observable_outcomes:
@@ -622,3 +622,5 @@ test_integrity_note:
```
Mutation evidence: removing the product display/visibility exclusion causes this scenario to fail with the hidden control IDs in its focus list (exit 1, 1 failed/0 passed). Mutant reverted. This fixes expensive JSDOM style evaluation in the test harness, not a demonstrated browser defect. Application CSS/layout remains outside this unit fixture's scope.
Fixture mutation: omitting native hidden-attribute filtering also fails the contract (exit 1, 1 failed/0 passed); restored before final checks.
@@ -10,3 +10,4 @@
- Deliberate product mutant removing display/visibility filtering: final regression exits 1, 1 failed/0 passed, hidden control IDs appear in actual focus list. Product restored byte-for-byte. Initial DOM-object diff diagnostic interrupted (130); replaced with control-ID diagnostics, no assertion relaxation.
- Initial sandbox lint: exit 2, git subprocess EPERM. Unrestricted lint then exposed forbidden direct style assignments in test fixture; corrected to fixture stylesheet classes. `npm run lint` unrestricted final run: exit 0, all 11 stages passed.
- Early full-unit diagnostic interrupted (130) before completion while final fixture was being prepared; no full pass claimed. Final committed/merged-tree checks follow in a separate log.
- Merged-tree isolated check at d0224078: exit 0, 27/27, 2700.15ms; lint 11/11 exit 0. Full diagnostic stopped before completion (130) for a fixture correction: preserve native `[hidden]` file-input display filtering. Added this control to the same contract scenario. Corrected isolated suite exits 0, 27/27. Fixture mutant omitting `[hidden]` filtering exits 1, 1 failed/0 passed; fixture restored. The full suite will restart on the final committed tree.
+2 -1
View File
@@ -137,7 +137,7 @@ beforeEach(() => {
document.head.appendChild(focusStyles);
nativeGetComputedStyle = window.getComputedStyle.bind(window);
window.getComputedStyle = (element) => ({
display: element.matches('.focus-test-display-none, input[type="hidden"]') ? 'none' : 'block',
display: element.matches('.focus-test-display-none, [hidden], input[type="hidden"]') ? 'none' : 'block',
visibility: element.closest('.focus-test-visibility-hidden') ? 'hidden' : 'visible',
});
@@ -1095,6 +1095,7 @@ test('focus trap excludes hidden and disabled controls with fixture and native s
addControl('visibility-hidden', (control) => { control.classList.add('focus-test-visibility-hidden'); });
addControl('aria-hidden', (control) => { control.setAttribute('aria-hidden', 'true'); });
addControl('hidden-input', (control) => { control.type = 'hidden'; });
addControl('hidden-attribute', (control) => { control.hidden = true; });
const inherited = addControl('inherited-visibility');
const hiddenParent = document.createElement('div');
hiddenParent.classList.add('focus-test-visibility-hidden');