Skip to content

Commit

Permalink
Ported move timeout repetition test
Browse files Browse the repository at this point in the history
  • Loading branch information
marekdedic committed Oct 21, 2023
1 parent bf20b44 commit aded462
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 46 deletions.
60 changes: 60 additions & 0 deletions __tests__/frontend-playwright/move-repeat-after-timeout.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import { expect, test } from "@playwright/test";

import { calls, setup } from "../test-utils-playwright/stub-endpoints";

test.beforeEach(async ({ page }) => {
await page.goto("/");
await setup(page);

await page.evaluate(() => {
const e = new Error();
e.name = "ScriptError";
window._endpointStubs.listSharedDrives = [
{
status: "success",
value: { status: "success", response: [] },
},
{
status: "success",
value: { status: "success", response: [] },
},
];
window._endpointStubs.move = [
{
status: "failure",
value: e,
},
{
status: "failure",
value: e,
},
{
status: "success",
value: { status: "success", response: { errors: [] } },
},
];
});
});

test("works with an unhandled move error", async ({ page }) => {
await expect(
page.getByText("Shared drive mover", { exact: true }),
).toBeVisible();
await page.getByText("Continue").click();
await page.getByText("My Drive").click();
await page.getByText("Continue").click();
await page.getByText("My Drive").click();
await page.getByText("Continue").click();
await expect(
page.getByText(
'contents of the folder "My Drive" into the folder "My Drive"',
),
).toBeVisible();
await page.getByText("Move", { exact: true }).click();
await expect(page.getByText("Done!", { exact: true })).toBeVisible();
await expect(page.getByText("Successfully moved")).toBeVisible();
expect(calls.move).toHaveLength(3);
expect(calls.move[0]).toStrictEqual(["root", "root", true, true, false]);
expect(calls.move[1]).toStrictEqual(["root", "root", true, true, false]);
expect(calls.move[1]).toStrictEqual(["root", "root", true, true, false]);
});
46 changes: 0 additions & 46 deletions __tests__/frontend/move-repeat-after-timeout.cy.ts

This file was deleted.

0 comments on commit aded462

Please sign in to comment.