Copilot commented on code in PR #7839:
URL: https://github.com/apache/texera/pull/7839#discussion_r3835711867


##########
frontend/src/app/workspace/component/agent/agent-panel/agent-chat/agent-chat.component.spec.ts:
##########
@@ -782,6 +784,60 @@ describe("AgentChatComponent", () => {
       expect(messages[1].querySelector("button")).toBeTruthy();
     });
 
+    it("pluralises the tool-call summary and opens the details modal from the 
hover button", () => {
+      createComponent();
+      // A pure tool-call step carries no text, so nothing here waits on 
<markdown>.
+      const step = makeStep({
+        content: "",
+        isBegin: true,
+        toolCalls: [{ toolName: "addOperator" }, { toolName: "runWorkflow" }],
+      });
+      agentService.stepsSubject.next([step]);
+      fixture.detectChanges();
+
+      const message = fixture.nativeElement.querySelector(".messages-container 
.message") as HTMLElement;
+      expect(message.textContent).toContain("Execute 2 tools");
+
+      // The newest step is auto-hovered, so its details button is the one 
rendered.
+      (message.querySelector("button") as HTMLButtonElement).click();
+      fixture.detectChanges();
+
+      expect(component.selectedResponse).toBe(step);
+      expect(component.isDetailsModalVisible).toBe(true);
+    });
+
+    it("closing the step-detail modal clears the flag through its two-way 
binding", () => {
+      createComponent();
+      component.showResponseDetails(makeStep());
+      fixture.detectChanges();
+      expect(component.isDetailsModalVisible).toBe(true);
+
+      // The child owns the close control; its visibleChange output is what 
drives
+      // the parent's [(visible)] binding back to false.
+      
fixture.debugElement.query(By.directive(ReActStepDetailModalComponent)).componentInstance.closeModal();
+      fixture.detectChanges();

Review Comment:
   `fixture.debugElement.query(...)` can return null; accessing 
`.componentInstance` directly produces a hard-to-diagnose "cannot read 
properties of null" error if the selector ever changes. Capture the debug 
element and assert it exists first so failures are actionable.



##########
frontend/src/app/dashboard/component/user/filters-instructions/filters-instructions.component.spec.ts:
##########
@@ -18,17 +18,26 @@
  */
 
 import { ComponentFixture, TestBed } from "@angular/core/testing";
+import { By } from "@angular/platform-browser";
+import { NoopAnimationsModule } from "@angular/platform-browser/animations";

Review Comment:
   The popover content is rendered into a CDK overlay; other frontend specs 
flush overlays with `TestBed.inject(ApplicationRef).tick()` to ensure overlay 
DOM is present before assertions. Adding an `ApplicationRef` import enables 
doing the same here, reducing flakiness when `.ant-popover` isn't attached yet.
   
   This issue also appears on line 65 of the same file.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to