Repository navigation
test(frontend): add unit tests for ReActStepDetailModalComponent - #5612
Merged
Yicong-Huang merged 1 commit intoJun 13, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5612 +/- ##
============================================
+ Coverage 52.40% 52.53% +0.12%
Complexity 2481 2481
============================================
Files 1070 1070
Lines 41360 41360
Branches 4441 4441
============================================
+ Hits 21676 21728 +52
+ Misses 18412 18352 -60
- Partials 1272 1280 +8
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new unit test specification for ReActStepDetailModalComponent in the frontend workspace agent panel, covering its pure formatting/parsing helper methods and simple state/output behavior.
Changes:
- Added a new
react-step-detail-modal.component.spec.tswith direct-instantiation tests (no TestBed) for the component’s pure helper methods. - Added coverage for modal visibility toggling, formatting utilities, tool-call/result parsing, operator-access helpers, and message role/text extraction logic.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Yicong-Huang
approved these changes
Jun 13, 2026
yangzhang75
added a commit
to yangzhang75/texera
that referenced
this pull request
Jun 22, 2026
…che#5612) <!-- Thanks for sending a pull request (PR)! Here are some tips for you: 1. If this is your first time, please read our contributor guidelines: [Contributing to Texera](https://github.com/apache/texera/blob/main/CONTRIBUTING.md) 2. Ensure you have added or run the appropriate tests for your PR 3. If the PR is work in progress, mark it a draft on GitHub. 4. Please write your PR title to summarize what this PR proposes, we are following Conventional Commits style for PR titles as well. 5. Be sure to keep the PR description updated to reflect all changes. --> ### What changes were proposed in this PR? <!-- Please clarify what changes you are proposing. The purpose of this section is to outline the changes. Here are some tips for you: 1. If you propose a new API, clarify the use case for a new API. 2. If you fix a bug, you can clarify why it is a bug. 3. If it is a refactoring, clarify what has been changed. 3. It would be helpful to include a before-and-after comparison using screenshots or GIFs. 4. Please consider writing useful notes for better and faster reviews. --> Adds unit tests for ReActStepDetailModalComponent, which previously had no spec. Covers the pure display helpers: closeModal, formatResult/formatJson, getToolResult, operator-access lookups, message role colors, getTextFromMessage, getToolCallSummaries, function-call formatting (incl. long-value truncation), and getToolResultFullItems/getToolResultItems (tool-name resolution, token count, trimmed flag). ### Any related issues, documentation, discussions? <!-- Please use this section to link other resources if not mentioned already. 1. If this PR fixes an issue, please include `Fixes apache#1234`, `Resolves apache#1234` or `Closes apache#1234`. If it is only related, simply mention the issue number. 2. If there is design documentation, please add the link. 3. If there is a discussion in the mailing list, please add the link. --> Closes apache#5468 ### How was this PR tested? <!-- If tests were added, say they were added here. Or simply mention that if the PR is tested with existing test cases. Make sure to include/update test cases that check the changes thoroughly including negative and positive cases if possible. If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future. If tests were not added, please describe why they were not added and/or why it was difficult to add. --> New spec run via ng test (Vitest): 22 tests pass. eslint and prettier checks clean. ### Was this PR authored or co-authored using generative AI tooling? <!-- If generative AI tooling has been used in the process of authoring this PR, please include the phrase: 'Generated-by: ' followed by the name of the tool and its version. If no, write 'No'. Please refer to the [ASF Generative Tooling Guidance](https://www.apache.org/legal/generative-tooling.html) for details. --> Generated-by: Claude Code (Claude Opus 4.8)
This was referenced Nov 10, 2026
renovate-bot
pushed a commit
to renovate-bot/apache-_-texera
that referenced
this pull request
Nov 10, 2026
) ### What changes were proposed in this PR? Removes the unused parts of the agent panel's `ReActStepDetailModalComponent`. **+1/−97 lines.** There is no behaviour change. - **The `agentId` input.** `agent-chat` binds it, but neither the modal's class nor its template reads it, so the binding goes too. - **`getMessageRoleColor` and `getToolCallStrings`,** with the private `formatAsFunction` that only the latter calls. The template never calls them. Only their own spec cases did, and those three cases go with them. - **`react-step-detail-modal.component.scss` and its `styleUrls` entry.** The file holds only the license header and one comment, so it emits no styles. The helpers the template does call (`getTextFromMessage`, `getToolCallSummaries`, the tool-result and operator-access helpers) and their spec cases stay. ### History | | | | --- | --- | | **Introduced by** | apache#4495 (2026-04-28), "feat(agent-service): add `agent-service` that manages LLM agents", together with the modal | | **Usage removed by** | **never used**. Only spec cases (apache#5612) ever called the two helpers | They have been unused for the six months since they were added. ### Any related issues, documentation, discussions? Closes apache#9392. ### How was this PR tested? No new tests. The modal's remaining cases stay. From `frontend/`: - `npx ng test --watch=false --include='**/react-step-detail-modal.component.spec.ts' --include='**/agent-chat.component.spec.ts' --include='**/agent-panel.component.spec.ts'`: 3 files, 125 tests, all pass. The last two specs cover the modal's host (`agent-chat`) and the panel around it. - `npx tsc --noEmit -p src/tsconfig.app.json` and `-p src/tsconfig.spec.json`: clean. - `yarn format:ci`: clean. - `yarn build` (production, AOT): success. To re-check: ``` git grep -n -E "getMessageRoleColor|getToolCallStrings|formatAsFunction|react-step-detail-modal.component.scss" # no hits git grep -n agentId -- frontend/src/app/workspace/component/agent/agent-panel/react-step-detail-modal # no hits ``` ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 5.5) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this PR?
Adds unit tests for ReActStepDetailModalComponent, which previously had no spec. Covers the pure display helpers: closeModal, formatResult/formatJson, getToolResult, operator-access lookups, message role colors, getTextFromMessage, getToolCallSummaries, function-call formatting (incl. long-value truncation), and getToolResultFullItems/getToolResultItems (tool-name resolution, token count, trimmed flag).
Any related issues, documentation, discussions?
Closes #5468
How was this PR tested?
New spec run via ng test (Vitest): 22 tests pass. eslint and prettier checks clean.
Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 4.8)