Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
add e2e test to make sure recent changes persist after editor editor …
Browse files Browse the repository at this point in the history
…remounts

Signed-off-by: Stefan Kracht <[email protected]>
  • Loading branch information
stefan-kracht committed Jan 8, 2024
1 parent 2549cb3 commit d4dc83d
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions e2e/explorer/workflow/diagramEditor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,3 +301,33 @@ test("it is possible to use the diagram view on the revisions detail page as wel
await expect(editor).toBeVisible();
await expect(diagram).toBeVisible();
});

test("it is possible to switch from Code View to Diagram View without loosing the recent changes", async ({
page,
}) => {
await page.goto(`/${namespace}/explorer/workflow/active/${workflow}`);

const { codeBtn, diagramBtn } = await getCommonPageElements(page);

const firstLine = page.getByText("direktiv_api: workflow/v1");
await firstLine.click();

const workflowChanges = "some changes to the workflows code";
await page.type("textarea", workflowChanges);
const recentlyChanges = page.getByText(workflowChanges);
await expect(
recentlyChanges,
"after the user typed new workflow code, it will be visible in the editor"
).toBeVisible();

await diagramBtn.click();
await expect(
recentlyChanges,
"when the user switches to the Diagram View, the most recent code changes are not visible anymore"
).not.toBeVisible();
await codeBtn.click();
await expect(
recentlyChanges,
"after the user switched back to the Editor View, the most recent chages are still in the Editor"
).toBeVisible();
});

0 comments on commit d4dc83d

Please sign in to comment.