test: Check the workflow tab and your functionalities (teste2e-workflow) (#12474)

* test: Check the workflow tab

* fix type

---------

Co-authored-by: gitstart-calcom <[email protected]>
Co-authored-by: GitStart-Cal.com <[email protected]>
Co-authored-by: CarinaWolli <[email protected]>
This commit is contained in:
authored and GitHub committed 2024-01-16 11:11:36 -05:00
1 parent ba944b471a
commit ca3e3600f7
8 files changed
+256 -71

No files matched your search

@@ -3,10 +3,8 @@ import type { NextApiRequest, NextApiResponse } from "next";
import { describe, expect } from "vitest";
import { appStoreMetadata } from "@calcom/app-store/appStoreMetaData";
import { OrganizerDefaultConferencingAppType } from "@calcom/app-store/locations";
import { CAL_URL, WEBAPP_URL } from "@calcom/lib/constants";
import { ErrorCode } from "@calcom/lib/errorCodes";
import { SchedulingType } from "@calcom/prisma/enums";
import { BookingStatus } from "@calcom/prisma/enums";
@@ -102,9 +102,11 @@ export default function WorkflowListPage({ workflows }: Props) {
{workflows.map((workflow, index) => {
const firstItem = workflows[0];
const lastItem = workflows[workflows.length - 1];
const dataTestId = `workflow-${workflow.name.toLowerCase().replaceAll(" ", "-")}`;
return (
<li
key={workflow.id}
data-testid={dataTestId}
className="group flex w-full max-w-full items-center justify-between overflow-hidden">
{!(firstItem && firstItem.id === workflow.id) && (
<ArrowButton onClick={() => moveWorkflow(index, -1)} arrowDirection="up" />
@@ -234,6 +236,7 @@ export default function WorkflowListPage({ workflows }: Props) {
StartIcon={Edit2}
disabled={workflow.readOnly}
onClick={async () => await router.replace(`/workflows/${workflow.id}`)}
data-testid="edit-button"
/>
</Tooltip>
<Tooltip content={t("delete") as string}>
@@ -246,6 +249,7 @@ export default function WorkflowListPage({ workflows }: Props) {
variant="icon"
disabled={workflow.readOnly}
StartIcon={Trash2}
data-testid="delete-button"
/>
</Tooltip>
</ButtonGroup>