## Description This PR adds another feature update we had planned for Auto Height - [ ] For new applications, in View and Preview mode, any widget which is invisible will let go of its space and collapse if it's either on the main Canvas or a container-like widget which has Auto-height enabled. - [ ] Widgets within a container-like Widget, say Tabs, that doesn't have Auto-height enabled, will now let go of their space if they're invisible. - [ ] The experience in Edit mode has not changed. TL;DR: In new applications, in the Preview and Published _AKA_ View modes, if a widget is invisible and within an Auto-height-enabled container like a Tab, a Modal, a Form, or the main Canvas, it will fully collapse, allowing widgets below it to move up and take its space. This changes the behavior today prior to the release of this PR for Auto-height-enabled widgets. Fixes #19983 Fixes #18681
79 lines
1.6 KiB
TypeScript
79 lines
1.6 KiB
TypeScript
import { mutation_setPropertiesToUpdate } from "./helpers";
|
|
|
|
describe("auto height saga helpers", () => {
|
|
it("When property exists, it should update correctly", () => {
|
|
const propertiesToUpdate = {
|
|
x: 50,
|
|
y: "newValue",
|
|
};
|
|
const originalObject = {
|
|
key1: [
|
|
{
|
|
propertyPath: "z",
|
|
propertyValue: 20,
|
|
},
|
|
],
|
|
};
|
|
const expectedResult = {
|
|
key1: [
|
|
{
|
|
propertyPath: "z",
|
|
propertyValue: 20,
|
|
},
|
|
{
|
|
propertyPath: "x",
|
|
propertyValue: 50,
|
|
},
|
|
{
|
|
propertyPath: "y",
|
|
propertyValue: "newValue",
|
|
},
|
|
],
|
|
};
|
|
const result = mutation_setPropertiesToUpdate(
|
|
originalObject,
|
|
"key1",
|
|
propertiesToUpdate,
|
|
);
|
|
expect(result).toStrictEqual(expectedResult);
|
|
});
|
|
it("When property does not exist, it should update correctly", () => {
|
|
const propertiesToUpdate = {
|
|
x: 50,
|
|
y: "newValue",
|
|
};
|
|
const originalObject = {
|
|
key1: [
|
|
{
|
|
propertyPath: "z",
|
|
propertyValue: 20,
|
|
},
|
|
],
|
|
};
|
|
const expectedResult = {
|
|
key1: [
|
|
{
|
|
propertyPath: "z",
|
|
propertyValue: 20,
|
|
},
|
|
],
|
|
key2: [
|
|
{
|
|
propertyPath: "x",
|
|
propertyValue: 50,
|
|
},
|
|
{
|
|
propertyPath: "y",
|
|
propertyValue: "newValue",
|
|
},
|
|
],
|
|
};
|
|
const result = mutation_setPropertiesToUpdate(
|
|
originalObject,
|
|
"key2",
|
|
propertiesToUpdate,
|
|
);
|
|
expect(result).toStrictEqual(expectedResult);
|
|
});
|
|
});
|