-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
feb1ea3
commit 7d2e650
Showing
2 changed files
with
74 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import { expect, test } from "@playwright/test"; | ||
|
||
import { setup } from "../test-utils-playwright/stub-endpoints"; | ||
|
||
test("works with non-empty destination folder", async ({ page }) => { | ||
await page.goto("/"); | ||
const getCalls = await setup(page); | ||
|
||
await page.evaluate(() => { | ||
window._endpointStubs.listSharedDrives = [ | ||
{ | ||
status: "success", | ||
value: { status: "success", response: [] }, | ||
}, | ||
{ | ||
status: "success", | ||
value: { status: "success", response: [] }, | ||
}, | ||
{ | ||
status: "success", | ||
value: { status: "success", response: [] }, | ||
}, | ||
]; | ||
window._endpointStubs.move = [ | ||
{ | ||
status: "success", | ||
delay: 500, | ||
value: { status: "error", type: "notEmpty" }, | ||
}, | ||
{ | ||
status: "success", | ||
delay: 500, | ||
value: { status: "error", type: "notEmpty" }, | ||
}, | ||
{ | ||
status: "success", | ||
value: { status: "success", response: { errors: [] } }, | ||
}, | ||
]; | ||
}); | ||
|
||
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("Destination not empty", { exact: true }), | ||
).toBeVisible(); | ||
await page.getByText("No", { exact: true }).click(); | ||
await page.getByText("Continue").click(); | ||
await page.getByText("Move", { exact: true }).click(); | ||
await expect( | ||
page.getByText("Destination not empty", { exact: true }), | ||
).toBeVisible(); | ||
await page.getByText("Yes").click(); | ||
await expect(page.getByText("Done!", { exact: true })).toBeVisible(); | ||
await expect(page.getByText("Successfully moved")).toBeVisible(); | ||
|
||
const moveCalls = getCalls("move"); | ||
expect(moveCalls).toHaveLength(3); | ||
expect(moveCalls[0]).toStrictEqual(["root", "root", true, true, false]); | ||
expect(moveCalls[1]).toStrictEqual(["root", "root", true, true, false]); | ||
expect(moveCalls[2]).toStrictEqual(["root", "root", true, true, true]); | ||
}); |
This file was deleted.
Oops, something went wrong.