diff --git a/src/frontend/src/components/GlobalVariableModal/GlobalVariableModal.tsx b/src/frontend/src/components/GlobalVariableModal/GlobalVariableModal.tsx index 116e9d095..bda803f07 100644 --- a/src/frontend/src/components/GlobalVariableModal/GlobalVariableModal.tsx +++ b/src/frontend/src/components/GlobalVariableModal/GlobalVariableModal.tsx @@ -14,6 +14,13 @@ import ForwardedIconComponent from "../genericIconComponent"; import InputComponent from "../inputComponent"; import { Input } from "../ui/input"; import { Label } from "../ui/label"; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "../ui/select"; import { Textarea } from "../ui/textarea"; import sortByName from "./utils/sort-by-name"; @@ -155,17 +162,28 @@ export default function GlobalVariableModal({ placeholder="Insert a name for the variable..." > - { - setType(e); - }} - selectedOption={type} - password={false} - options={["Generic", "Credential"]} - placeholder="Choose a type for the variable..." - id={"type-global-variables"} - > + + + {type === "Credential" ? ( { await page .getByPlaceholder("Insert a name for the variable...") .fill(randomName); - await page.getByTestId("anchor-popover-anchor-type-global-variables").click(); - await page.getByPlaceholder("Search options...").fill("Generic"); - await page.waitForTimeout(1000); - await page.getByText("Generic", { exact: true }).last().isVisible(); - await page.getByText("Generic", { exact: true }).last().click(); - - await page.getByTestId("popover-anchor-type-global-variables").click(); - await page.waitForTimeout(1000); - await page.getByPlaceholder("Search options...").fill("Generic"); + await page.getByTestId("select-type-global-variables").first().click(); await page.getByText("Generic", { exact: true }).last().isVisible(); await page.getByText("Generic", { exact: true }).last().click(); @@ -108,18 +100,6 @@ test("should interact with global variables", async ({ page }) => { await page.waitForTimeout(2000); - // const focusElementsOnBoard = async ({ page }) => { - // await page.waitForSelector( - // '[aria-label="Press Space to toggle all rows selection (unchecked)"]', - // { timeout: 30000, state: "visible" }, - // ); - // const focusElements = await page - // .getByLabel("Press Space to toggle all rows selection (unchecked)") - // .first(); - // await focusElements.click(); - // }; - // await focusElementsOnBoard({ page }); - await page.locator(".ag-checkbox-input").first().click(); await page.getByTestId("icon-Trash2").click(); await page.getByText("No data available").isVisible();