Skip to content

Commit b644eff

Browse files
committed
Updated to Adapter changes
1 parent 36df50e commit b644eff

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const clipboard = new Clipboard(nativeActions);
2525
const keyboard = new Keyboard(nativeActions);
2626
const mouse = new Mouse(nativeActions);
2727
const movement = new Movement(nativeActions, new LineHelper());
28-
const screen = new Screen(screenActions, nativeActions);
28+
const screen = new Screen(screenActions);
2929
const assert = new Assert(screen);
3030

3131
export { clipboard, keyboard, mouse, movement, screen, assert };

lib/assert.class.spec.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { NativeAdapter } from "./adapter/native.adapter.class";
21
import { VisionAdapter } from "./adapter/vision.adapter.class";
32
import { Assert } from "./assert.class";
43
import { Region } from "./region.class";
@@ -11,23 +10,23 @@ jest.mock("./screen.class");
1110
describe("Assert", () => {
1211
it("isVisible should not throw if a match is found.", async () => {
1312
Screen.prototype.findOnScreen = jest.fn(() => Promise.resolve(new Region(0, 0, 100, 100)));
14-
const screenMock = new Screen(new VisionAdapter(), new NativeAdapter());
13+
const screenMock = new Screen(new VisionAdapter());
1514
const SUT = new Assert(screenMock);
1615

1716
await expect(SUT.isVisible("foo")).resolves.not.toThrowError();
1817
});
1918

2019
it("isVisible should throw if a match is found.", async () => {
2120
Screen.prototype.findOnScreen = jest.fn(() => Promise.reject("foo"));
22-
const screenMock = new Screen(new VisionAdapter(), new NativeAdapter());
21+
const screenMock = new Screen(new VisionAdapter());
2322
const SUT = new Assert(screenMock);
2423

2524
await expect(SUT.isVisible("foo")).rejects.toThrowError("Element not found");
2625
});
2726

2827
it("isVisible should throw if a match is found.", async () => {
2928
Screen.prototype.findOnScreen = jest.fn(() => Promise.reject("foo"));
30-
const screenMock = new Screen(new VisionAdapter(), new NativeAdapter());
29+
const screenMock = new Screen(new VisionAdapter());
3130
const SUT = new Assert(screenMock);
3231
const searchRegion = new Region(10, 10, 10, 10);
3332

@@ -39,15 +38,15 @@ describe("Assert", () => {
3938

4039
it("isNotVisible should throw if a match is found.", async () => {
4140
Screen.prototype.findOnScreen = jest.fn(() => Promise.resolve(new Region(0, 0, 100, 100)));
42-
const screenMock = new Screen(new VisionAdapter(), new NativeAdapter());
41+
const screenMock = new Screen(new VisionAdapter());
4342
const SUT = new Assert(screenMock);
4443

4544
await expect(SUT.notVisible("foo")).rejects.toThrowError("Element visible");
4645
});
4746

4847
it("isVisible should throw if a match is found.", async () => {
4948
Screen.prototype.findOnScreen = jest.fn(() => Promise.reject("foo"));
50-
const screenMock = new Screen(new VisionAdapter(), new NativeAdapter());
49+
const screenMock = new Screen(new VisionAdapter());
5150
const SUT = new Assert(screenMock);
5251

5352
await expect(SUT.notVisible("foo")).resolves.not.toThrowError();

0 commit comments

Comments
 (0)