aglinxinyuan opened a new pull request, #7426:
URL: https://github.com/apache/texera/pull/7426

   ### What changes were proposed in this PR?
   
   The settings form is four near-identical Save/Reset cards, three 
near-identical upload blocks, and twelve sidebar switches. All 31 of its 
template listeners and all 34 of its branches were unhit, because the existing 
suite calls the component's methods directly and never renders an interaction.
   
   The realistic defect in a template shaped like this is cross-wiring from 
copy-paste, and two switch keys are one character apart:
   
   - `workflow_enabled` vs `workflows_enabled`
   - `dataset_enabled` vs `datasets_enabled`
   
   A swap between either pair is invisible on screen and silently toggles the 
wrong sidebar entry.
   
   Adds 12 tests. The central one walks the twelve switches in template order 
and asserts each flips **exactly one** setting and no other — that is what 
catches a swap between the confusable pairs. Alongside it:
   
   - the Hub children locked until Hub is on, and the Your Work children until 
Your Work is on
   - the three section switches never locked, since locking one behind itself 
would make it impossible to switch back on
   - each of the five number inputs owning its own field
   - each card's Save and Reset reaching that card's own handler
   - each "Choose a …" button opening its own hidden input, and each file input 
tagging its change with its own setting key
   - the previews rendering only for images that have been chosen
   
   **Verified by mutation**, all reverted (template diff empty):
   
   | Mutation | Result |
   |---|---|
   | make the `workflows` switch write `workflow_enabled` | red |
   | make the `datasets` switch write `dataset_enabled` | red |
   | gate a Hub child on Your Work instead | red |
   | gate About on Hub | red |
   | gate the Hub section on itself | red |
   | point the tabs Save at the dataset handler | red |
   | point the csv Reset at the branding handler | red |
   | make the logo picker open the favicon input | red |
   | tag the mini-logo change as `logo` | red |
   | make the chunk-size input write `maxFileSizeMiB` | red |
   | render the logo preview unconditionally | red |
   | make the mini-logo preview show the logo | red |
   
   The preview mutation **survived its first run**: the test set `logoData`, so 
removing that image's `*ngIf` changed nothing. A no-data case now covers it — 
without the guard a card renders a broken image on first load.
   
   No production file is touched.
   
   ### Any related issues, documentation, discussions?
   
   Closes #7423
   
   ### How was this PR tested?
   
   ```
   npx ng test --watch=false --include="**/admin-settings.component.spec.ts"
   ```
   
   ```
    Test Files  1 passed (1)
         Tests  36 passed (36)
   ```
   
   12 new on top of the existing 24. `yarn format:ci` passes.
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Opus 5)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to