fix(sensor-placement): refine drawing export and editor density
Build Push and Deploy / docker-image (push) Failing after 23s
Build Push and Deploy / deploy-fallback-log (push) Successful in 1s

This commit is contained in:
2026-07-30 21:39:27 +08:00
parent 81cc5dcae1
commit 65ed1fd212
5 changed files with 230 additions and 314 deletions
@@ -31,7 +31,20 @@ jest.mock("@components/olmap/core/MapComponent", () => ({
}));
jest.mock("@mui/x-data-grid", () => ({
DataGrid: () => <div data-testid="scheme-grid" />,
DataGrid: (props: {
density?: string;
initialState?: { density?: string };
rowHeight?: number;
columnHeaderHeight?: number;
}) => (
<div
data-testid="scheme-grid"
data-density={props.density ?? "uncontrolled"}
data-initial-density={props.initialState?.density ?? ""}
data-row-height={props.rowHeight ?? "automatic"}
data-column-header-height={props.columnHeaderHeight ?? "automatic"}
/>
),
GridToolbar: () => null,
}));
@@ -173,4 +186,25 @@ describe("SchemeEditor notifications", () => {
message: "请先点击要替换的监测点",
});
});
it("lets the Data Grid density selector control row sizing", () => {
render(<SchemeEditor scheme={scheme} network="fengyang" />);
expect(screen.getByTestId("scheme-grid")).toHaveAttribute(
"data-density",
"uncontrolled",
);
expect(screen.getByTestId("scheme-grid")).toHaveAttribute(
"data-initial-density",
"compact",
);
expect(screen.getByTestId("scheme-grid")).toHaveAttribute(
"data-row-height",
"automatic",
);
expect(screen.getByTestId("scheme-grid")).toHaveAttribute(
"data-column-header-height",
"automatic",
);
});
});