Skip to content

test(frontend): cover ListItemComponent edit helpers and FilesUploaderComponent conflict prompts#6760

Open
mengw15 wants to merge 10 commits into
apache:mainfrom
mengw15:chore/6749-listitem-filesuploader-test
Open

test(frontend): cover ListItemComponent edit helpers and FilesUploaderComponent conflict prompts#6760
mengw15 wants to merge 10 commits into
apache:mainfrom
mengw15:chore/6749-listitem-filesuploader-test

Conversation

@mengw15

@mengw15 mengw15 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Extends two dashboard component specs to cover their remaining untested
edit/interaction methods (Vitest; no production code changed).

ListItemComponent (+5 tests) — setEditingState (toggles the name /
description edit flags), renderMarkdownPreview (strips markdown syntax and
collapses whitespace), and updateProperty (missing-id guard, success
persistence + exit-edit-mode, and error revert + notify).

Note: the other ListItem methods the issue lists (onEditName /
onEditDescription / toggleLike / onCheckboxChange / openDetailModal /
initializeEntry / confirmUpdate*) are already covered on main (added in
#6557), so this PR only fills the remaining gaps.

FilesUploaderComponent (+4 tests) — markForceRestart (flags the item),
getOwnerAndName (returns the owner/name inputs), and askResumeOrSkip /
askUploadOrSkip (resolve with the clicked conflict-modal footer action). The
modal is driven through the spec's existing capturing double.

Any related issues, documentation, discussions?

Closes #6749

How was this PR tested?

Extended unit tests, run locally in frontend/ (all green; each spec's failure
path was verified by breaking an assertion to confirm it goes red):

ng test --watch=false --include src/app/dashboard/component/user/list-item/list-item.component.spec.ts        # 25 passed
ng test --watch=false --include src/app/dashboard/component/user/files-uploader/files-uploader.component.spec.ts # 12 passed
prettier --write <specs>   # clean
eslint  <specs>            # clean

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

Generated-by: Claude Code (Opus 4.8 [1M context])

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

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

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

  • No candidates found from git blame history.

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 extends existing Angular/Vitest unit tests in the dashboard area to cover remaining untested helper/interaction methods in ListItemComponent and FilesUploaderComponent, without changing production code.

Changes:

  • Added tests for ListItemComponent’s editing-state toggles, markdown preview normalization, and updateProperty guard/success/error paths.
  • Added tests for FilesUploaderComponent’s force-restart flagging, owner/name getter, and conflict-resolution modal footer actions.

Reviewed changes

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

File Description
frontend/src/app/dashboard/component/user/list-item/list-item.component.spec.ts Adds coverage for editing helpers, markdown preview rendering, and updateProperty behaviors.
frontend/src/app/dashboard/component/user/files-uploader/files-uploader.component.spec.ts Adds coverage for restart flagging, owner/name accessors, and conflict prompt modal actions.

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

Comment thread frontend/src/app/dashboard/component/user/list-item/list-item.component.spec.ts Outdated

@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 22, 2026
@codecov-commenter

codecov-commenter commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.43%. Comparing base (3149eb5) to head (6dc2431).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6760      +/-   ##
============================================
- Coverage     76.44%   76.43%   -0.01%     
+ Complexity     3456     3445      -11     
============================================
  Files          1161     1161              
  Lines         45922    45919       -3     
  Branches       5101     5100       -1     
============================================
- Hits          35105    35099       -6     
- Misses         9269     9274       +5     
+ Partials       1548     1546       -2     
Flag Coverage Δ *Carryforward flag
access-control-service 70.00% <ø> (ø) Carriedforward from 718862c
agent-service 76.76% <ø> (ø) Carriedforward from 718862c
amber 67.26% <ø> (-0.08%) ⬇️ Carriedforward from 718862c
computing-unit-managing-service 20.49% <ø> (ø) Carriedforward from 718862c
config-service 66.66% <ø> (ø) Carriedforward from 718862c
file-service 67.21% <ø> (ø) Carriedforward from 718862c
frontend 82.13% <ø> (+0.03%) ⬆️
notebook-migration-service 78.94% <ø> (ø) Carriedforward from 718862c
pyamber 92.15% <ø> (ø) Carriedforward from 718862c
workflow-compiling-service 55.14% <ø> (ø) Carriedforward from 718862c

*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 removed this pull request from the merge queue due to a manual request Jul 22, 2026
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 ListItemComponent and FilesUploaderComponent

4 participants