fix: disable save button when workflow has no changes (#25973)
* fix: disable save button when workflow has no changes * test: wait for save button to be enabled before clicking * test: ensure input value is set before pressing Enter * test fix * fix: add shouldDirty to enable save button on name change * test: clean up workflow test fixtures * fix: disable save button when workflow has no changes * test: update workflow E2E tests * test: fix workflow E2E * fix: enable save button when workflow form fields change * fix tests * fix: disable save button when workflow has no changes * remove comments * chore: improve fixture logic * cleanup: remove unnecessary changes * update workflow fixture to handle team workflow creation --------- Co-authored-by: Pallav <[email protected]> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Rajiv Sahal <[email protected]> Co-authored-by: Romit <[email protected]> Co-authored-by: Romit <[email protected]> Co-authored-by: Romit <[email protected]>
This commit is contained in:
3 files changed
+42
-26
No files matched your search
@@ -31,11 +31,16 @@ export function createWorkflowPageFixture(page: Page) {
|
||||
if (name) {
|
||||
await fillNameInput(name);
|
||||
}
|
||||
if (trigger) {
|
||||
await page.locator("#trigger-select").click();
|
||||
await page.getByTestId(`select-option-${trigger ?? WorkflowTriggerEvents.BEFORE_EVENT}`).click();
|
||||
|
||||
await page.locator("#trigger-select").click();
|
||||
await page.getByTestId(`select-option-${trigger ?? WorkflowTriggerEvents.BEFORE_EVENT}`).click();
|
||||
|
||||
if (isTeam) {
|
||||
await page.getByText(/Apply to all team/i).first().click();
|
||||
} else {
|
||||
await selectEventType("30 min");
|
||||
}
|
||||
|
||||
const workflow = await saveWorkflow();
|
||||
|
||||
for (const step of workflow.steps) {
|
||||
@@ -50,7 +55,7 @@ export function createWorkflowPageFixture(page: Page) {
|
||||
|
||||
const saveWorkflow = async () => {
|
||||
const submitPromise = page.waitForResponse("/api/trpc/workflows/update?batch=1");
|
||||
const saveButton = await page.getByTestId("save-workflow");
|
||||
const saveButton = page.getByTestId("save-workflow");
|
||||
await saveButton.click();
|
||||
const response = await submitPromise;
|
||||
expect(response.status()).toBe(200);
|
||||
@@ -67,8 +72,9 @@ export function createWorkflowPageFixture(page: Page) {
|
||||
|
||||
const fillNameInput = async (name: string) => {
|
||||
await page.getByTestId("edit-workflow-name-button").click();
|
||||
await page.getByTestId("workflow-name").fill(name);
|
||||
await page.keyboard.press("Enter");
|
||||
const nameInput = page.getByTestId("workflow-name");
|
||||
await nameInput.fill(name);
|
||||
await nameInput.blur();
|
||||
};
|
||||
|
||||
const editSelectedWorkflow = async (name: string) => {
|
||||
|
||||
Reference in new issue
Block a user