Skip to content

Commit 73381cc

Browse files
[autofix.ci] apply automated fixes
1 parent 314199e commit 73381cc

File tree

1 file changed

+43
-43
lines changed

1 file changed

+43
-43
lines changed

src/frontend/tests/core/unit/codeAreaModalComponent.spec.ts

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,33 @@ import { test } from "../../fixtures";
33
import { awaitBootstrapTest } from "../../utils/await-bootstrap-test";
44

55
test(
6-
"CodeAreaModalComponent",
7-
{ tag: ["@release", "@workspace"] },
8-
async ({ page }) => {
9-
await awaitBootstrapTest(page);
6+
"CodeAreaModalComponent",
7+
{ tag: ["@release", "@workspace"] },
8+
async ({ page }) => {
9+
await awaitBootstrapTest(page);
1010

11-
await page.waitForSelector('[data-testid="blank-flow"]', {
12-
timeout: 3000,
13-
});
11+
await page.waitForSelector('[data-testid="blank-flow"]', {
12+
timeout: 3000,
13+
});
1414

15-
await page.getByTestId("blank-flow").click();
15+
await page.getByTestId("blank-flow").click();
1616

17-
await page.getByTestId("canvas_controls_dropdown").click();
17+
await page.getByTestId("canvas_controls_dropdown").click();
1818

19-
await page.waitForSelector('[data-testid="zoom_out"]', {
20-
timeout: 3000,
21-
});
22-
await page.getByTestId("canvas_controls_dropdown").click({ force: true });
19+
await page.waitForSelector('[data-testid="zoom_out"]', {
20+
timeout: 3000,
21+
});
22+
await page.getByTestId("canvas_controls_dropdown").click({ force: true });
2323

24-
await page.getByTestId("sidebar-custom-component-button").click();
24+
await page.getByTestId("sidebar-custom-component-button").click();
2525

26-
await expect(page.getByTestId("code-button-modal")).toBeVisible({
27-
timeout: 3000,
28-
});
26+
await expect(page.getByTestId("code-button-modal")).toBeVisible({
27+
timeout: 3000,
28+
});
2929

30-
await page.getByTestId("code-button-modal").last().click();
30+
await page.getByTestId("code-button-modal").last().click();
3131

32-
const codeInputCode = `
32+
const codeInputCode = `
3333
# from langflow.field_typing import Data
3434
from langflow.custom import Component
3535
from langflow.io import CodeInput, Output
@@ -62,20 +62,20 @@ class CustomComponent(Component):
6262
sleep(60)
6363
return data`;
6464

65-
await page.locator(".ace_content").click();
66-
await page.keyboard.press(`ControlOrMeta+A`);
67-
await page.locator("textarea").fill(codeInputCode);
65+
await page.locator(".ace_content").click();
66+
await page.keyboard.press(`ControlOrMeta+A`);
67+
await page.locator("textarea").fill(codeInputCode);
6868

69-
await page.getByText("Check & Save").last().click();
69+
await page.getByText("Check & Save").last().click();
7070

71-
await page.getByTestId("div-generic-node").click();
71+
await page.getByTestId("div-generic-node").click();
7272

73-
await page.getByTestId("codearea_code_function_code").click();
73+
await page.getByTestId("codearea_code_function_code").click();
7474

75-
const wCode =
76-
'def python_function(text: str) -> st: """This is a default python function that returns the input text""" return text';
75+
const wCode =
76+
'def python_function(text: str) -> st: """This is a default python function that returns the input text""" return text';
7777

78-
const customComponentCode = `from typing import Callable
78+
const customComponentCode = `from typing import Callable
7979
from langflow.field_typing import Code
8080
from langflow.interface.custom.custom_component import CustomComponent
8181
from langflow.interface.custom.utils import get_function
@@ -85,19 +85,19 @@ class PythonFunctionComponent(CustomComponent):
8585
"""This is a default python function that returns the input text"""
8686
return text`;
8787

88-
await page.locator(".ace_content").click();
89-
await page.locator("textarea").press("ControlOrMeta+a");
90-
await page.locator("textarea").fill(wCode);
91-
await page.locator('//*[@id="checkAndSaveBtn"]').click();
92-
await expect(
93-
page.getByText("invalid syntax (<unknown>, line 1)"),
94-
).toBeVisible({ timeout: 3000 });
95-
await page.locator("textarea").press("ControlOrMeta+a");
96-
await page.locator("textarea").fill(customComponentCode);
97-
await page.locator('//*[@id="checkAndSaveBtn"]').click();
98-
await expect(page.getByTestId("codearea_code_function_code")).toHaveText(
99-
customComponentCode,
100-
{ timeout: 3000 },
101-
);
102-
},
88+
await page.locator(".ace_content").click();
89+
await page.locator("textarea").press("ControlOrMeta+a");
90+
await page.locator("textarea").fill(wCode);
91+
await page.locator('//*[@id="checkAndSaveBtn"]').click();
92+
await expect(
93+
page.getByText("invalid syntax (<unknown>, line 1)"),
94+
).toBeVisible({ timeout: 3000 });
95+
await page.locator("textarea").press("ControlOrMeta+a");
96+
await page.locator("textarea").fill(customComponentCode);
97+
await page.locator('//*[@id="checkAndSaveBtn"]').click();
98+
await expect(page.getByTestId("codearea_code_function_code")).toHaveText(
99+
customComponentCode,
100+
{ timeout: 3000 },
101+
);
102+
},
103103
);

0 commit comments

Comments
 (0)