You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@texera.apache.org by gi...@apache.org on 2026/07/22 01:40:18 UTC

(texera) branch gh-readonly-queue/main/pr-6695-ddd4e3d20eef17a232067d68c46e026bbcaf5aed created (now 27dbc095b2)

This is an automated email from the ASF dual-hosted git repository.

github-merge-queue[bot] pushed a change to branch gh-readonly-queue/main/pr-6695-ddd4e3d20eef17a232067d68c46e026bbcaf5aed
in repository https://gitbox.apache.org/repos/asf/texera.git


      at 27dbc095b2 test(frontend): cover getDefaultLinkCell (#6695)

This branch includes the following new commits:

     new 27dbc095b2 test(frontend): cover getDefaultLinkCell (#6695)

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(texera) 01/01: test(frontend): cover getDefaultLinkCell (#6695)

Posted by gi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/main/pr-6695-ddd4e3d20eef17a232067d68c46e026bbcaf5aed
in repository https://gitbox.apache.org/repos/asf/texera.git

commit 27dbc095b2e5253c19a256a6d5e1147f9cbb9016
Author: Matthew B. <mg...@uci.edu>
AuthorDate: Tue Jul 21 18:38:31 2026 -0700

    test(frontend): cover getDefaultLinkCell (#6695)
    
    ### What changes were proposed in this PR?
    - Add coverage for JointUIService.getDefaultLinkCell (manhattan router,
    rounded connector).
    - Assert the connection stroke, hidden remove tool, and source and
    target marker attributes.
    ### Any related issues, documentation, discussions?
    Closes: #6694
    ### 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/joint-ui/joint-ui.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
---
 .../service/joint-ui/joint-ui.service.spec.ts      | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/frontend/src/app/workspace/service/joint-ui/joint-ui.service.spec.ts b/frontend/src/app/workspace/service/joint-ui/joint-ui.service.spec.ts
index 87b5acd924..d34a9eb2b3 100644
--- a/frontend/src/app/workspace/service/joint-ui/joint-ui.service.spec.ts
+++ b/frontend/src/app/workspace/service/joint-ui/joint-ui.service.spec.ts
@@ -290,6 +290,32 @@ describe("JointUIService", () => {
     });
   });
 
+  describe("getDefaultLinkCell (static)", () => {
+    it("builds a link routed with manhattan and connected with rounded corners", () => {
+      const link = JointUIService.getDefaultLinkCell();
+      expect(link).toBeInstanceOf(joint.dia.Link);
+      expect(link.get("router")).toEqual({ name: "manhattan" });
+      expect(link.get("connector")).toEqual({ name: "rounded" });
+    });
+
+    it("styles the connection stroke and hides the remove tool by default", () => {
+      const link = JointUIService.getDefaultLinkCell();
+      expect(link.attr(".connection/stroke")).toBe("#919191");
+      expect(link.attr(".connection/stroke-width")).toBe("2px");
+      // the delete affordance is present in the markup but hidden until hover.
+      expect(link.attr(".tool-remove/display")).toBe("none");
+      expect(link.attr(".tool-remove/fill")).toBe("#D8656A");
+    });
+
+    it("fills the source and target markers with the handle color", () => {
+      const link = JointUIService.getDefaultLinkCell();
+      expect(link.attr(".marker-source/fill")).toBe("#919191");
+      expect(link.attr(".marker-target/fill")).toBe("#919191");
+      expect(link.attr(".marker-source/stroke")).toBe("none");
+      expect(link.attr(".marker-target/stroke")).toBe("none");
+    });
+  });
+
   describe("getJointUserPointerName (static)", () => {
     it("prefixes the coeditor clientId with 'pointer_'", () => {
       expect(JointUIService.getJointUserPointerName({ clientId: "abc123" } as Coeditor)).toBe("pointer_abc123");