Skip to content

test(frontend): cover updateOrCreatePreset and preset guards#6691

Merged
aglinxinyuan merged 3 commits into
apache:mainfrom
Ma77Ball:test/preset-service-helpers-spec
Jul 23, 2026
Merged

test(frontend): cover updateOrCreatePreset and preset guards#6691
aglinxinyuan merged 3 commits into
apache:mainfrom
Ma77Ball:test/preset-service-helpers-spec

Conversation

@Ma77Ball

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

  • Add branch coverage for PresetService.updateOrCreatePreset (identical, push, no-op, implicit-delete, replace).
  • Add tests for the isValidPreset and isValidPresetArray type guards.

Any related issues, documentation, discussions?

Closes: #6690

How was this PR tested?

  • Run: cd frontend && node --max-old-space-size=8192 ./node_modules/nx/dist/bin/nx.js test gui --watch=false --include=src/app/workspace/service/preset/preset.service.spec.ts, expect the suite passing.
  • Test-only change; no production code is modified.

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

Co-authored with Claude Opus 4.8 in compliance with ASF

@github-actions github-actions Bot added the frontend Changes related to the frontend GUI label Jul 21, 2026
@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @aglinxinyuan
    You can notify them by mentioning @aglinxinyuan in a comment.

Copilot AI 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.

Pull request overview

This PR adds frontend unit tests to increase coverage for PresetService.updateOrCreatePreset and the Ajv-backed preset type guards, aligning with issue #6690’s goal of improving test coverage in the preset workflow.

Changes:

  • Added branch-coverage tests for PresetService.updateOrCreatePreset (identical, append, replacement-exists, implicit-delete, replace).
  • Added tests for the isValidPreset and isValidPresetArray Ajv type guards.

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

Comment thread frontend/src/app/workspace/service/preset/preset.service.spec.ts Outdated
Comment thread frontend/src/app/workspace/service/preset/preset.service.spec.ts Outdated
Comment thread frontend/src/app/workspace/service/preset/preset.service.spec.ts
Comment thread frontend/src/app/workspace/service/preset/preset.service.spec.ts Outdated
Ma77Ball and others added 2 commits July 21, 2026 19:52
@aglinxinyuan

Copy link
Copy Markdown
Contributor

Merged main to trigger coverage report.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.27%. Comparing base (110a54c) to head (8b9edb3).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #6691   +/-   ##
=========================================
  Coverage     76.27%   76.27%           
  Complexity     3452     3452           
=========================================
  Files          1161     1161           
  Lines         45919    45917    -2     
  Branches       5100     5100           
=========================================
  Hits          35025    35025           
+ Misses         9329     9327    -2     
  Partials       1565     1565           
Flag Coverage Δ *Carryforward flag
access-control-service 70.00% <ø> (ø) Carriedforward from c24755c
agent-service 76.76% <ø> (ø) Carriedforward from c24755c
amber 67.33% <ø> (ø) Carriedforward from c24755c
computing-unit-managing-service 20.49% <ø> (ø) Carriedforward from c24755c
config-service 66.66% <ø> (ø) Carriedforward from c24755c
file-service 67.21% <ø> (ø) Carriedforward from c24755c
frontend 81.71% <ø> (+<0.01%) ⬆️ Carriedforward from c24755c
notebook-migration-service 78.94% <ø> (ø) Carriedforward from c24755c
pyamber 92.15% <ø> (ø) Carriedforward from c24755c
workflow-compiling-service 55.14% <ø> (ø) Carriedforward from c24755c

*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.

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

@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Jul 23, 2026
Merged via the queue into apache:main with commit e2e4418 Jul 23, 2026
21 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 test coverage for updateOrCreatePreset

4 participants