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


##########
frontend/src/app/workspace/component/left-panel/left-panel.component.spec.ts:
##########
@@ -315,6 +317,141 @@ describe("LeftPanelComponent", () => {
     freshFixture.destroy();
   });
 
+  // ── Rendered template: tab lists + their (click)/event bindings ──
+  describe("template tab rendering & interactions", () => {
+    // Draggable tabs render with the CDK `cdk-drag` class; the collapse 
"minus"
+    // button does not. Enabled tabs render in `order` sequence, so the frame's
+    // list position is its index among the currently-enabled frames.
+    const tabForFrame = (containerId: string, frame: number): DebugElement | 
undefined => {
+      const tabs = fixture.debugElement.queryAll(By.css(`#${containerId} 
li[nz-menu-item].cdk-drag`));
+      const pos = component.order.filter(i => 
component.items[i].enabled).indexOf(frame);
+      return pos >= 0 ? tabs[pos] : undefined;
+    };
+    const minusOf = (containerId: string): DebugElement | null =>
+      fixture.debugElement.query(By.css(`#${containerId} 
li[nz-menu-item]:not(.cdk-drag)`));
+
+    it("clicking a tab in the collapsed dock opens that frame", () => {
+      // default state is collapsed (width 0) -> #docked-buttons shows the 
enabled tabs
+      const versionsTab = tabForFrame("docked-buttons", 2);
+      expect(versionsTab).toBeTruthy();
+
+      versionsTab!.triggerEventHandler("click", null);
+
+      expect(component.currentIndex).toBe(2);
+      expect(component.width).toBe(230); // collapsed -> re-opened
+    });

Review Comment:
   These assertions assume the panel starts collapsed (width = 0), but the 
component constructor opens a frame by default and leaves `width` at 
`MIN_PANEL_WIDTH` (230). Without explicitly collapsing + running change 
detection, `#docked-buttons` won’t render the draggable tabs (`*ngIf="... && 
!width"`), so this test will be brittle/incorrect.
   
   This issue also appears on line 344 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