Skip to content

test(frontend): add FormlyRepeatDndComponent unit tests - #5632

Merged
Yicong-Huang merged 5 commits into
apache:mainfrom
lie18uci:test/5464-formly-repeat-dnd
Jun 16, 2026
Merged

test(frontend): add FormlyRepeatDndComponent unit tests#5632
Yicong-Huang merged 5 commits into
apache:mainfrom
lie18uci:test/5464-formly-repeat-dnd

Conversation

@lie18uci

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

This PR adds frontend unit tests for FormlyRepeatDndComponent.
The new spec verifies that:

  • The component is created successfully.
  • onDrop does nothing when previousIndex == currentIndex.
  • onDrop does nothing when model is undefined.
  • onDrop reorders model, field.fieldGroup, and formControl on the happy path.
  • props.reorder is called after a successful reorder.
    This improves test coverage for the drag-and-drop reorder behavior without changing existing component behavior.

Any related issues, documentation, discussions?

Closes #5464

How was this PR tested?

Ran the following command locally from the frontend directory:
yarn test --include='**/repeat-dnd.component.spec.ts'

The test passed successfully with 1 test file passed and 4 tests passed.
Also ran:
yarn lint

^ yarn lint completed successfully.

Was this PR authored or co-authored using generative AI tooling?

Generated-by: ChatGPT

@github-actions github-actions Bot added the frontend Changes related to the frontend GUI label Jun 12, 2026
@lie18uci

Copy link
Copy Markdown
Contributor Author

/request-review @Ma77Ball

@codecov-commenter

codecov-commenter commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.23%. Comparing base (9cede6f) to head (f9164b3).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5632      +/-   ##
============================================
+ Coverage     53.07%   53.23%   +0.16%     
+ Complexity     2657     2504     -153     
============================================
  Files          1094     1076      -18     
  Lines         42286    41665     -621     
  Branches       4541     4503      -38     
============================================
- Hits          22444    22182     -262     
+ Misses        18530    18174     -356     
+ Partials       1312     1309       -3     
Flag Coverage Δ *Carryforward flag
access-control-service 71.42% <ø> (+0.51%) ⬆️ Carriedforward from 6becb85
agent-service 34.36% <ø> (ø) Carriedforward from 6becb85
amber 53.88% <ø> (+0.45%) ⬆️ Carriedforward from 6becb85
computing-unit-managing-service 1.65% <ø> (ø) Carriedforward from 6becb85
config-service 56.71% <ø> (ø) Carriedforward from 6becb85
file-service 57.06% <ø> (ø) Carriedforward from 6becb85
frontend 47.95% <ø> (+0.02%) ⬆️
pyamber 90.71% <ø> (+0.93%) ⬆️ Carriedforward from 6becb85
python 90.73% <ø> (ø) Carriedforward from 6becb85
workflow-compiling-service 58.69% <ø> (ø) Carriedforward from 6becb85

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@xuang7 xuang7 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, left one minor comment.

Comment thread frontend/src/app/common/formly/repeat-dnd/repeat-dnd.component.spec.ts Outdated
@xuang7
xuang7 added this pull request to the merge queue Jun 15, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 15, 2026
@xuang7
xuang7 added this pull request to the merge queue Jun 15, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 15, 2026
@xuang7
xuang7 added this pull request to the merge queue Jun 15, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 15, 2026
@Yicong-Huang
Yicong-Huang added this pull request to the merge queue Jun 16, 2026
Merged via the queue into apache:main with commit 5869492 Jun 16, 2026
17 checks passed
yangzhang75 pushed a commit to yangzhang75/texera that referenced this pull request Jun 22, 2026
### What changes were proposed in this PR?

This PR adds frontend unit tests for `FormlyRepeatDndComponent`.
The new spec verifies that:

* The component is created successfully.
* onDrop does nothing when previousIndex == currentIndex.
* onDrop does nothing when model is undefined.
* onDrop reorders model, field.fieldGroup, and formControl on the happy
path.
* props.reorder is called after a successful reorder.
This improves test coverage for the drag-and-drop reorder behavior
without changing existing component behavior.

### Any related issues, documentation, discussions?

Closes apache#5464

### How was this PR tested?
Ran the following command locally from the frontend directory:
yarn test --include='**/repeat-dnd.component.spec.ts'

The test passed successfully with 1 test file passed and 4 tests passed.
Also ran:
yarn lint

^ yarn lint completed successfully.

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: ChatGPT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add unit tests for FormlyRepeatDndComponent

4 participants