blob: d4c61c4c36889f3d92b3ff1f07bafbecbc83c5e5 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
import * as operations from "../../../../src/shared/operations";
import ClipboardOperatorFactoryChain from "../../../../src/content/operators/impls/ClipboardOperatorFactoryChain";
import YankURLOperator from "../../../../src/content/operators/impls/YankURLOperator";
import PasteOperator from "../../../../src/content/operators/impls/PasteOperator";
import MockClipboardRepository from "../../mock/MockClipboardRepository";
import MockOperationClient from "../../mock/MockOperationClient";
import MockSettingRepository from "../../mock/MockSettingRepository";
import MockConsoleClient from "../../mock/MockConsoleClient";
import MockURLRepository from "../../mock/MockURLRepository";
describe("ClipboardOperatorFactoryChain", () => {
describe("#create", () => {
it("returns an operator", () => {
const sut = new ClipboardOperatorFactoryChain(
new MockClipboardRepository(),
new MockConsoleClient(),
new MockOperationClient(),
new MockSettingRepository(),
new MockURLRepository()
);
expect(sut.create({ type: operations.URLS_YANK }, 0)).toBeInstanceOf(
YankURLOperator
);
expect(
sut.create({ type: operations.URLS_PASTE, newTab: false }, 0)
).toBeInstanceOf(PasteOperator);
expect(sut.create({ type: operations.SCROLL_TOP }, 0)).toBeNull;
});
});
});
|