bugfix: add steps to delete flows caused by new constraints (#3045)

* 📝 (flows.py): refactor delete_multiple_flows function to improve readability and efficiency
✨ (use-delete-flows.ts): add useDeleteFlows hook to handle deletion of multiple flows in frontend
♻️ (index.tsx): refactor handleDeleteMultiple function to use useDeleteFlows hook for deleting multiple flows
🔧 (actionsMainPage-shard-1.spec.ts): add test for selecting and deleting a flow in end-to-end tests

* 📝 (flows.py): Remove unused imports and variables to clean up the code and improve readability
♻️ (flows.py): Refactor code to remove unnecessary import and variable declarations, making the code more concise and maintainable

* add unit tests to delete multiple flows with transactions and build

* format

* add assert on tests
This commit is contained in:
Cristhian Zanforlin Lousa 2024-07-30 10:41:54 -03:00 • committed by GitHub
commit c2b5b98b64
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 175 additions and 17 deletions

View file

@ -36,6 +36,41 @@ test("select and delete all", async ({ page }) => {
await page.getByText("Selected items deleted successfully").isVisible();
});
test("select and delete a flow", async ({ page }) => {
await page.goto("/");
await page.waitForTimeout(2000);
let modalCount = 0;
try {
const modalTitleElement = await page?.getByTestId("modal-title");
if (modalTitleElement) {
modalCount = await modalTitleElement.count();
}
} catch (error) {
modalCount = 0;
}
while (modalCount === 0) {
await page.getByText("New Project", { exact: true }).click();
await page.waitForTimeout(5000);
modalCount = await page.getByTestId("modal-title")?.count();
}
await page.getByRole("heading", { name: "Basic Prompting" }).click();
await page.waitForSelector('[data-testid="icon-ChevronLeft"]', {
timeout: 100000,
});
await page.getByTestId("icon-ChevronLeft").first().click();
await page.getByTestId("checkbox-component").first().click();
await page.getByTestId("icon-Trash2").click();
await page.getByText("Delete").last().click();
await page.waitForTimeout(1000);
await page.getByText("Selected items deleted successfully").isVisible();
});
test("search flows", async ({ page }) => {
await page.goto("/");
await page.waitForTimeout(2000);