fix: finalize market alignment release

This commit is contained in:
2026-05-09 12:06:19 +08:00
parent a5aad4f165
commit 2e049ef718
5 changed files with 40 additions and 127 deletions
-41
View File
@@ -7,7 +7,6 @@ import {
applyRowVisibility,
findNextPageControl,
isPageControlDisabled,
readMarketAlignmentDiagnostics,
readMarketPageSignature,
renderMarketRowState,
syncMarketTable
@@ -354,46 +353,6 @@ describe("market-dom-sync", () => {
expect(readSelectionCellHeights()).toEqual(["152px", "152px"]);
});
test("reads alignment diagnostics for selection cells against native rows", () => {
document.body.innerHTML = buildRealMarketGridFixture();
const table = syncMarketTable(document);
if (!table) {
throw new Error("Expected market table");
}
const firstSelectionCell = table.rows[0].selectionCheckbox.parentElement as HTMLElement;
const secondSelectionCell = table.rows[1].selectionCheckbox.parentElement as HTMLElement;
vi.spyOn(firstSelectionCell, "getBoundingClientRect").mockReturnValue(
createRect({ height: 24, top: 100 })
);
vi.spyOn(table.rows[0].row, "getBoundingClientRect").mockReturnValue(
createRect({ height: 120, top: 120 })
);
vi.spyOn(secondSelectionCell, "getBoundingClientRect").mockReturnValue(
createRect({ height: 24, top: 260 })
);
vi.spyOn(table.rows[1].row, "getBoundingClientRect").mockReturnValue(
createRect({ height: 120, top: 250 })
);
expect(readMarketAlignmentDiagnostics(table)).toEqual([
expect.objectContaining({
authorId: "111",
checkboxTop: 100,
rowTop: 120,
topDelta: -20
}),
expect.objectContaining({
authorId: "222",
checkboxTop: 260,
rowTop: 250,
topDelta: 10
})
]);
});
test("uses native-like alignment styles for plugin cells", () => {
document.body.innerHTML = buildRealMarketGridFixtureWithScopedAttributes();