aboutsummaryrefslogtreecommitdiff
path: root/test/content/operators/impls/VerticalScrollOperator.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'test/content/operators/impls/VerticalScrollOperator.test.ts')
-rw-r--r--test/content/operators/impls/VerticalScrollOperator.test.ts28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/content/operators/impls/VerticalScrollOperator.test.ts b/test/content/operators/impls/VerticalScrollOperator.test.ts
new file mode 100644
index 0000000..05b15d2
--- /dev/null
+++ b/test/content/operators/impls/VerticalScrollOperator.test.ts
@@ -0,0 +1,28 @@
+import { expect } from "chai";
+import VerticalScrollOperator from "../../../../src/content/operators/impls/VerticalScrollOperator";
+import MockScrollPresenter from "../../mock/MockScrollPresenter";
+import MockSettingRepository from "../../mock/MockSettingRepository";
+
+describe("VerticalScrollOperator", () => {
+ describe("#run", () => {
+ it("scroll vertically", async () => {
+ const presenter = new MockScrollPresenter();
+ const settingRepository = new MockSettingRepository();
+ const sut = new VerticalScrollOperator(presenter, settingRepository, 1);
+
+ await sut.run();
+
+ expect(presenter.getScroll()).to.deep.equal({ x: 0, y: 1 });
+ });
+
+ it("scroll vertically with repeats", async () => {
+ const presenter = new MockScrollPresenter();
+ const settingRepository = new MockSettingRepository();
+ const sut = new VerticalScrollOperator(presenter, settingRepository, 5);
+
+ await sut.run();
+
+ expect(presenter.getScroll()).to.deep.equal({ x: 0, y: 5 });
+ });
+ });
+});