Skip to content

test: add real specs for left-panel SettingsComponent #4992

Merged
aglinxinyuan merged 5 commits intoapache:mainfrom
Ma77Ball:test/left-panel-Settings
May 9, 2026
Merged

test: add real specs for left-panel SettingsComponent #4992
aglinxinyuan merged 5 commits intoapache:mainfrom
Ma77Ball:test/left-panel-Settings

Conversation

@Ma77Ball
Copy link
Copy Markdown
Contributor

@Ma77Ball Ma77Ball commented May 8, 2026

What changes were proposed in this PR?

Replaced the placeholder spec at frontend/src/app/workspace/component/left-panel/settings/settings.component.spec.ts (previously just a license header) with 10 real test cases for SettingsComponent:

  • Component creation
  • Form initialization from the current workflow settings
  • dataTransferBatchSize validators (min(1) and required)
  • confirmUpdateDataTransferBatchSize writes through to WorkflowActionService and persists when the user is logged in
  • The > 0 guard in confirmUpdateDataTransferBatchSize blocks invalid values
  • UserService.isLogin() gate skips persistence when the user is logged out
  • updateExecutionMode writes through to the workflow service and persists
  • persistWorkflow errors are surfaced via NotificationService.error
  • Form valueChanges propagate both controls to the action service
  • Form valueChanges ignore invalid values

Also removed settings.component.spec.ts from the placeholder exclusion lists in frontend/angular.json (test builder exclude) and frontend/src/tsconfig.spec.json (exclude) so the spec is actually compiled and run.

Any related issues, documentation, or discussions?

Closes: #4965

How was this PR tested?

Ran the new spec via the Angular/Vitest test runner:

npx ng test --watch=false --include="src/app/workspace/component/left-panel/settings/settings.component.spec.ts"

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

Co-Authored with Claude Opus 4.7 in compliance with ASF

@github-actions github-actions Bot added the frontend Changes related to the frontend GUI label May 8, 2026
@Ma77Ball
Copy link
Copy Markdown
Contributor Author

Ma77Ball commented May 9, 2026

/request-review @aglinxinyuan

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a real Vitest unit test suite for the workspace left-panel SettingsComponent and enables it in the Angular/Vitest test build so it’s compiled and executed as part of the frontend test run.

Changes:

  • Implemented a full SettingsComponent spec covering form initialization, validation, and service/persistence interactions.
  • Removed settings.component.spec.ts from Angular/Vitest exclude lists so the test is discovered and run.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
frontend/src/app/workspace/component/left-panel/settings/settings.component.spec.ts Replaces placeholder with a set of unit tests validating form behavior and persistence wiring.
frontend/angular.json Removes the spec from the unit-test builder exclude list so it runs under Vitest.
frontend/src/tsconfig.spec.json Removes the spec from TS exclude so it’s type-checked/compiled in the spec build.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Ma77Ball Ma77Ball force-pushed the test/left-panel-Settings branch from 10cc9fd to 6f1e61e Compare May 9, 2026 06:54
@aglinxinyuan aglinxinyuan enabled auto-merge (squash) May 9, 2026 07:01
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 43.13%. Comparing base (c1a8d0f) to head (60e3e7b).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #4992      +/-   ##
============================================
- Coverage     43.18%   43.13%   -0.05%     
+ Complexity     2186     2175      -11     
============================================
  Files          1031     1031              
  Lines         38153    38104      -49     
  Branches       4004     3997       -7     
============================================
- Hits          16475    16435      -40     
+ Misses        20641    20639       -2     
+ Partials       1037     1030       -7     
Flag Coverage Δ *Carryforward flag
access-control-service 39.53% <ø> (ø) Carriedforward from 6b79896
agent-service 33.72% <ø> (ø) Carriedforward from 6b79896
amber 43.09% <ø> (-0.13%) ⬇️ Carriedforward from 6b79896
computing-unit-managing-service 0.00% <ø> (ø) Carriedforward from 6b79896
config-service 0.00% <ø> (ø) Carriedforward from 6b79896
file-service 31.83% <ø> (-0.36%) ⬇️ Carriedforward from 6b79896
frontend 34.56% <ø> (+0.27%) ⬆️
python 88.07% <ø> (-0.83%) ⬇️ Carriedforward from 6b79896
workflow-compiling-service 47.72% <ø> (ø) Carriedforward from 6b79896

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

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aglinxinyuan aglinxinyuan merged commit 502287b into apache:main May 9, 2026
15 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 left-panel SettingsComponent

5 participants