Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DONOT MERGE] - Testing External Contributor PR with CI checks #33349

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import {
agHelper,
assertHelper,
draggableWidgets,
locators,
entityExplorer,
propPane,
} from "../../../../support/Objects/ObjectsCore";
import EditorNavigation, {
EntityType,
} from "../../../../support/Pages/EditorNavigation";

describe(
"Dynamic Height Adjustment for Statbox Widget",
{ tags: ["@tag.AutoHeight"] },
function () {
before(() => {
entityExplorer.DragDropWidgetNVerify(draggableWidgets.STATBOX);
});
it("Validate decreasing height of Statbox widget by removing its widgets", function () {
propPane.AssertPropertiesDropDownCurrentValue("Height", "Auto Height");

// Function to delete widget and verify height change
function deleteWidgetAndVerifyHeightChange(widgetName: string) {
agHelper
.GetWidgetCSSHeight(
locators._widgetInDeployed(draggableWidgets.STATBOX),
)
.then(($currentStatboxHeight) => {
EditorNavigation.SelectEntityByName(
widgetName,
EntityType.Widget,
{},
["Statbox1"],
);
agHelper.PressDelete();
agHelper.WaitUntilAllToastsDisappear();
assertHelper.AssertNetworkStatus("updateLayout");
agHelper.Sleep(2000);

agHelper
.GetWidgetCSSHeight(
locators._widgetInDeployed(draggableWidgets.STATBOX),
)
.then(($updatedStatboxHeight) => {
// Verify that the height of the Statbox widget has decreased
expect($currentStatboxHeight).to.not.equal(
$updatedStatboxHeight,
);
});
});
}
Comment on lines +23 to +52
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider replacing the hardcoded sleep with a more reliable wait condition to avoid flaky tests.


// Delete bottom text widget from statbox and verify height change
deleteWidgetAndVerifyHeightChange("Text3");

// Delete icon button widget from statbox and verify height change
deleteWidgetAndVerifyHeightChange("IconButton1");
});
},
);
1 change: 0 additions & 1 deletion app/client/src/widgets/StatboxWidget/widget/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ class StatboxWidget extends ContainerWidget {
backgroundColor: "white",
borderWidth: "1",
borderColor: Colors.GREY_5,
minDynamicHeight: 14,
children: [],
positioning: Positioning.Fixed,
responsiveBehavior: ResponsiveBehavior.Fill,
Expand Down