Skip to content

test(frontend): add unit tests for DatasetFileSelectorComponent#5576

Merged
xuang7 merged 1 commit into
apache:mainfrom
yangzhang75:test/dataset-file-selector-spec
Jun 10, 2026
Merged

test(frontend): add unit tests for DatasetFileSelectorComponent#5576
xuang7 merged 1 commit into
apache:mainfrom
yangzhang75:test/dataset-file-selector-spec

Conversation

@yangzhang75

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Adds a unit test spec for DatasetFileSelectorComponent, which previously had no *.spec.ts. The component is a Formly field type whose onClickOpenFileSelectionModal() opens a dataset-selection modal and writes the chosen path back into the form control when the modal closes with a value.

Any related issues, documentation, discussions?

Closes #5471

How was this PR tested?

New unit tests added in dataset-file-selector.component.spec.ts, run via ng test (Vitest). They cover:

  • component creation
  • onClickOpenFileSelectionModal() opens the dataset selection modal exactly once
  • a selected path is written back into the form control
  • the form control is left unchanged when the modal is dismissed without a path
  • isFileSelectionEnabled reflects the GUI config

All 5 tests pass; eslint and prettier checks are clean.

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

Generated-by: Claude Code

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

@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!

@xuang7 xuang7 enabled auto-merge June 10, 2026 02:14
@xuang7 xuang7 disabled auto-merge June 10, 2026 02:15
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.20%. Comparing base (564ccdb) to head (f33241f).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5576      +/-   ##
============================================
+ Coverage     52.17%   52.20%   +0.02%     
  Complexity     2482     2482              
============================================
  Files          1068     1068              
  Lines         41311    41311              
  Branches       4439     4439              
============================================
+ Hits          21556    21565       +9     
+ Misses        18490    18480      -10     
- Partials       1265     1266       +1     
Flag Coverage Δ *Carryforward flag
access-control-service 64.61% <ø> (ø) Carriedforward from 564ccdb
agent-service 33.76% <ø> (ø) Carriedforward from 564ccdb
amber 53.28% <ø> (ø) Carriedforward from 564ccdb
computing-unit-managing-service 1.65% <ø> (ø) Carriedforward from 564ccdb
config-service 56.06% <ø> (ø) Carriedforward from 564ccdb
file-service 38.32% <ø> (ø) Carriedforward from 564ccdb
frontend 46.47% <ø> (+0.05%) ⬆️
pyamber 90.72% <ø> (ø) Carriedforward from 564ccdb
python 90.75% <ø> (ø) Carriedforward from 564ccdb
workflow-compiling-service 58.69% <ø> (ø) Carriedforward from 564ccdb

*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 added this pull request to the merge queue Jun 10, 2026
Merged via the queue into apache:main with commit cd60535 Jun 10, 2026
18 checks passed
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 DatasetFileSelectorComponent

3 participants