-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
6 changed files
with
106 additions
and
11 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
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
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
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,41 @@ | ||
import { test, expect } from "@playwright/test"; | ||
import { | ||
scrollTo, | ||
scrollToEnd, | ||
expectScrollPosition, | ||
sleep, | ||
expectProgress, | ||
setProgress, | ||
} from "./support"; | ||
|
||
test.describe("API", () => { | ||
test.beforeEach(async ({ page }) => { | ||
await page.goto("/"); | ||
}); | ||
|
||
test("gets the current progress after mirroring", async ({ page }) => { | ||
await scrollToEnd(page, "first-vertical"); | ||
await sleep(1000); | ||
await expectProgress(page, "vertical", { x: 0, y: 1 }); | ||
}); | ||
|
||
test("sets the progress vertically", async ({ page }) => { | ||
await setProgress(page, "vertical", { y: 0.5 }); | ||
await expectProgress(page, "vertical", { x: 0, y: 0.5 }); | ||
}); | ||
|
||
test("sets the progress horizontally", async ({ page }) => { | ||
await setProgress(page, "horizontal", { x: 0.5 }); | ||
await expectProgress(page, "horizontal", { x: 0.5, y: 0 }); | ||
}); | ||
|
||
test("sets the progress in both directions", async ({ page }) => { | ||
// two values (x, y) | ||
await setProgress(page, "both", { x: 0.25, y: 0.75 }); | ||
await expectProgress(page, "both", { x: 0.25, y: 0.75 }); | ||
|
||
// And one value for both directions | ||
await setProgress(page, "both", 0.5); | ||
await expectProgress(page, "both", { x: 0.5, y: 0.5 }); | ||
}); | ||
}); |
2 changes: 1 addition & 1 deletion
2
tests/e2e/tests/features.spec.ts → tests/e2e/tests/mirroring.spec.ts
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
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