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

   ### What changes were proposed in this PR?
   
   The existing suite drives `onDrop` directly and never renders, so everything 
the template owns was unpinned.
   
   Adds 8 tests. The remove index is the one that matters: it comes from the 
`ngFor` loop variable, and a fixed or off-by-one index deletes someone else's 
row while every row looks identical on screen. Also covered: one row per entry, 
the drag handle, the add button's wiring, its label falling back to `"Add"`, 
and the add button locking for a disabled section.
   
   **Verified by mutation**, all reverted (template diff empty):
   
   | Mutation | Result |
   |---|---|
   | remove uses a fixed index | red |
   | add button unwired | red |
   | add label ignores the field's own | red |
   | add label loses its default | red |
   | add button never disabled | red |
   | only the first row rendered | red |
   | drag handle removed | red |
   
   The drag-handle test **survived its first mutation**: it asserted the 
`.drag-handle` class, which is styling and survives `cdkDragHandle` being 
dropped — leaving the row undraggable with the test still green. It now asserts 
the directive.
   
   ### A production bug this surfaced
   
   The per-row remove button's `[disabled]` guard never takes effect. The rows 
are `*ngFor="let field of field.fieldGroup"`, which **shadows** the component's 
`field`, so inside a row `field.templateOptions?.disabled` reads the 
sub-field's options and is always `undefined`. The add button, outside the 
loop, reads the same expression correctly and does disable.
   
   Filed as #7431. This PR deliberately asserts the add button's gating and 
**not** the remove buttons', so the current behaviour is not cemented before 
the fix.
   
   No production file is touched.
   
   ### Any related issues, documentation, discussions?
   
   Closes #7433
   
   ### How was this PR tested?
   
   ```
   npx ng test --watch=false --include="**/repeat-dnd.component.spec.ts"
   ```
   
   ```
    Test Files  1 passed (1)
         Tests  12 passed (12)
   ```
   
   8 new on top of the existing 4. `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