## Description This PR adds one of the promised updates to the auto height feature. More specifically, we wanted to add was the ability to see the containers change height as we drag and drop widgets within them instead of after dropping (when auto height is enabled) This PR does that. Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
44 lines
1.1 KiB
TypeScript
44 lines
1.1 KiB
TypeScript
import { getNodesAndStylesToUpdate } from "./mutateDOM";
|
|
describe("DOM mutations", () => {
|
|
it("Computes the correct values to update based on widgetsToUpdate", () => {
|
|
const widgetsToUpdate = {
|
|
m: [
|
|
{
|
|
propertyValue: 100,
|
|
propertyPath: "bottomRow",
|
|
},
|
|
{
|
|
propertyValue: 10,
|
|
propertyPath: "topRow",
|
|
},
|
|
],
|
|
n: [
|
|
{
|
|
propertyValue: 100,
|
|
propertyPath: "bottomRow",
|
|
},
|
|
],
|
|
o: [
|
|
{
|
|
propertyValue: 100,
|
|
propertyPath: "bottomRow",
|
|
},
|
|
{
|
|
propertyValue: 0,
|
|
propertyPath: "topRow",
|
|
},
|
|
],
|
|
};
|
|
const widgetsMeasuredInPixels = ["n", "o"];
|
|
const result = getNodesAndStylesToUpdate(
|
|
widgetsToUpdate,
|
|
widgetsMeasuredInPixels,
|
|
);
|
|
expect(result).toStrictEqual({
|
|
m: { y: 106, height: 900 },
|
|
n: { y: 6, height: 100 }, // Since we're absolutely positioning the canvas widges, this y value is correct
|
|
o: { y: 6, height: 100 },
|
|
});
|
|
});
|
|
});
|