feat: Clear handles from advanced fields on code update (#8754)
* ✨ (frontend): add new function clearHandlesFromAdvancedFields to handle clearing handles from advanced fields when code is updated 📝 (frontend): update documentation and add tests for deleting handles from advanced fields when code is updated 🔧 (frontend): remove unused style for Outlook in styleUtils to clean up code 🔧 (frontend): add test for deleting handles from advanced fields when code is updated in general-bugs-delete-handle-advanced-input.spec * ✨ (frontend): add support for managing edges and nodes in the flowStore to improve data handling and flow visualization ♻️ (frontend): refactor cleanEdges function to accept an object with nodes, edges, componentId, and data parameters for better modularity and reusability * ✨ (codeAreaModal/index.tsx): Refactor import statements and function names for better clarity and organization ♻️ (flowStore.ts): Refactor cleanEdges function to accept nodes and edges as separate arguments instead of an object ♻️ (flowStore.ts): Update all calls to cleanEdges function to pass nodes and edges separately ♻️ (reactflowUtils.ts): Refactor clearHandlesFromAdvancedFields function to accept only necessary arguments and remove unnecessary logic
This commit is contained in:
parent
04f8f90649
commit
65b71bec5b
4 changed files with 132 additions and 3 deletions
|
|
@ -0,0 +1,89 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
import { awaitBootstrapTest } from "../../utils/await-bootstrap-test";
|
||||
import { extractAndCleanCode } from "../../utils/extract-and-clean-code";
|
||||
import { zoomOut } from "../../utils/zoom-out";
|
||||
|
||||
test(
|
||||
"the system must delete the handles from advanced fields when the code is updated",
|
||||
{ tag: ["@release"] },
|
||||
async ({ page }) => {
|
||||
await awaitBootstrapTest(page);
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
|
||||
await page.waitForSelector('[data-testid="fit_view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("if else");
|
||||
|
||||
await page
|
||||
.getByTestId("logicIf-Else")
|
||||
.hover()
|
||||
.then(async () => {
|
||||
await page.getByTestId("add-component-button-if-else").click();
|
||||
});
|
||||
|
||||
await page.getByTestId("fit_view").click();
|
||||
await zoomOut(page, 3);
|
||||
|
||||
await page.getByTestId("edit-button-modal").click();
|
||||
|
||||
await page.getByTestId("showmessage").click();
|
||||
|
||||
await page.getByText("Close").last().click();
|
||||
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("text input");
|
||||
await page.waitForSelector('[data-testid="input_outputText Input"]', {
|
||||
timeout: 2000,
|
||||
});
|
||||
await page
|
||||
.getByTestId("input_outputText Input")
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'), {
|
||||
targetPosition: { x: 200, y: 100 },
|
||||
});
|
||||
|
||||
await page
|
||||
.getByTestId("handle-textinput-shownode-output text-right")
|
||||
.click();
|
||||
|
||||
await page
|
||||
.getByTestId("handle-conditionalrouter-shownode-alternative output-left")
|
||||
.click();
|
||||
|
||||
await page.getByTestId("title-If-Else").click();
|
||||
|
||||
await page.getByTestId("edit-button-modal").click();
|
||||
|
||||
const numberOfDisabledInputs = await page
|
||||
.getByPlaceholder("Receiving input")
|
||||
.count();
|
||||
|
||||
expect(numberOfDisabledInputs).toBe(2);
|
||||
|
||||
const numberOfLockIcons = await page.getByTestId("icon-lock").count();
|
||||
|
||||
expect(numberOfLockIcons).toBe(2);
|
||||
|
||||
await page.getByText("Close").last().click();
|
||||
|
||||
await page.getByTestId("title-If-Else").click();
|
||||
|
||||
await page.getByTestId("code-button-modal").click();
|
||||
|
||||
await page.getByTestId("checkAndSaveBtn").last().click();
|
||||
|
||||
await page.getByTestId("edit-button-modal").click();
|
||||
|
||||
const numberOfDisabledInputsAfter = await page
|
||||
.getByPlaceholder("Receiving input")
|
||||
.count();
|
||||
|
||||
expect(numberOfDisabledInputsAfter).toBe(0);
|
||||
|
||||
const numberOfLockIconsAfter = await page.getByTestId("icon-lock").count();
|
||||
|
||||
expect(numberOfLockIconsAfter).toBe(0);
|
||||
},
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue