feat(FN-3087): document graph plugin in plugin authoring guide
Documentation-only finish for FN-3087, adding changeset and README updates for the dependency graph plugin and plugin authoring guide. Fusion-Task-Id: FN-3087
This commit is contained in:
@@ -117,4 +117,11 @@ describe("DependencyGraph", () => {
|
||||
fireEvent.click(screen.getByTestId("task-A"));
|
||||
expect(onOpenDetail).toHaveBeenCalledWith(expect.objectContaining({ id: "A" }));
|
||||
});
|
||||
|
||||
it("falls back to onOpenTaskDetail when onOpenDetail is not provided", () => {
|
||||
const onOpenTaskDetail = vi.fn();
|
||||
render(<DependencyGraph tasks={[createTask("A", "in-progress")]} onOpenTaskDetail={onOpenTaskDetail} />);
|
||||
fireEvent.click(screen.getByTestId("task-A"));
|
||||
expect(onOpenTaskDetail).toHaveBeenCalledWith("A");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -40,6 +40,19 @@ afterEach(() => {
|
||||
});
|
||||
|
||||
describe("GraphTaskNode drag", () => {
|
||||
it("does not open detail after drag threshold is exceeded", () => {
|
||||
const onOpenDetail = vi.fn();
|
||||
render(<GraphTaskNode {...props({ onOpenDetail })} />);
|
||||
const node = screen.getByTestId("graph-task-node-FN-1");
|
||||
|
||||
fireEvent.pointerDown(node, { pointerId: 1, clientX: 10, clientY: 10, isPrimary: true });
|
||||
fireEvent.pointerMove(node, { pointerId: 1, clientX: 25, clientY: 25, isPrimary: true });
|
||||
fireEvent.pointerUp(node, { pointerId: 1, clientX: 25, clientY: 25, isPrimary: true });
|
||||
fireEvent.click(node);
|
||||
|
||||
expect(onOpenDetail).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("applies dragging class only after threshold move", () => {
|
||||
const onNodePositionChange = vi.fn();
|
||||
render(<GraphTaskNode {...props({ onNodePositionChange })} />);
|
||||
|
||||
@@ -11,7 +11,7 @@ describe("dependency graph plugin host integration contract", () => {
|
||||
expect.objectContaining({
|
||||
viewId: "graph",
|
||||
label: "Graph",
|
||||
componentPath: "./src/DependencyGraph.tsx",
|
||||
componentPath: "./dashboard-view",
|
||||
placement: "more",
|
||||
}),
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user