✨ (GenericNode/index.tsx): add unique id to input element for accessibility and testing purposes
🐛 (input.tsx): add missing data-testid attribute to input element 🐛 (group.spec.ts): fix test case to correctly group and ungroup nodes, update selectors to match changes in UI
This commit is contained in:
parent
6216337ed9
commit
aa2c148614
3 changed files with 18 additions and 18 deletions
|
|
@ -444,6 +444,7 @@ export default function GenericNode({
|
|||
onChange={setNodeName}
|
||||
password={false}
|
||||
blurOnEnter={true}
|
||||
id={`input-title-${data.node?.display_name}`}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
|||
({ className, type, ...props }, ref) => {
|
||||
return (
|
||||
<input
|
||||
data-testid=""
|
||||
type={type}
|
||||
className={cn(
|
||||
"nopan nodelete nodrag noundo nocopy primary-input",
|
||||
|
|
|
|||
|
|
@ -1,29 +1,27 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
import { test } from "@playwright/test";
|
||||
|
||||
test.describe("group node test", () => {
|
||||
/// <reference lib="dom"/>
|
||||
test("group and ungroup updating values", async ({ page }) => {
|
||||
await page.goto("http:localhost:3000/");
|
||||
await page.goto("/");
|
||||
await page.locator('//*[@id="new-project-btn"]').click();
|
||||
|
||||
await page.getByRole("heading", { name: "Data Ingestion" }).click();
|
||||
await page
|
||||
.getByRole("heading", { name: "Basic Prompting" })
|
||||
.first()
|
||||
.click();
|
||||
await page.waitForTimeout(2000);
|
||||
await page.getByLabel("fit view").click();
|
||||
await page.keyboard.down("Control");
|
||||
await page
|
||||
.getByTestId("title-OpenAIEmbeddings")
|
||||
.click({ modifiers: ["Control"] });
|
||||
await page.getByTestId("title-URL").click({ modifiers: ["Control"] });
|
||||
await page
|
||||
.getByTestId("title-Recursive Character Text Splitter")
|
||||
.click({ modifiers: ["Control"] });
|
||||
await page.keyboard.up("Control");
|
||||
await page.getByLabel("fit view").first().click();
|
||||
await page.getByTestId("title-OpenAI").click({ modifiers: ["Control"] });
|
||||
await page.getByTestId("title-Prompt").click({ modifiers: ["Control"] });
|
||||
await page.getByTestId("title-OpenAI").click({ modifiers: ["Control"] });
|
||||
|
||||
await page.getByRole("button", { name: "Group" }).click();
|
||||
await page.getByTestId(/input-collection_name_Chroma-.*/).click();
|
||||
await page.getByTestId(/input-collection_name_Chroma-.*/).fill("test");
|
||||
await page.getByTestId("title-Group").click();
|
||||
await page.getByTestId("title-Group").dblclick();
|
||||
await page.getByTestId("input-title-Group").first().fill("test");
|
||||
await page.getByTestId("icon-Ungroup").first().click();
|
||||
await page.keyboard.press("Control+g");
|
||||
const value = await page.getByTestId("input-collection_name").inputValue();
|
||||
expect(value).toBe("test");
|
||||
await page.getByTestId("title-OpenAI").isVisible();
|
||||
await page.getByTestId("title-Prompt").isVisible();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue