1
1
import { VisionAdapter } from "./adapter/vision.adapter.class" ;
2
- import { Assert } from "./assert.class" ;
2
+ import { AssertClass } from "./assert.class" ;
3
3
import { Region } from "./region.class" ;
4
- import { Screen } from "./screen.class" ;
4
+ import { ScreenClass } from "./screen.class" ;
5
5
6
6
jest . mock ( "./adapter/native.adapter.class" ) ;
7
7
jest . mock ( "./adapter/vision.adapter.class" ) ;
@@ -10,9 +10,9 @@ jest.mock("./screen.class");
10
10
describe ( "Assert" , ( ) => {
11
11
it ( "isVisible should not throw if a match is found." , async ( ) => {
12
12
// GIVEN
13
- Screen . prototype . find = jest . fn ( ( ) => Promise . resolve ( new Region ( 0 , 0 , 100 , 100 ) ) ) ;
14
- const screenMock = new Screen ( new VisionAdapter ( ) ) ;
15
- const SUT = new Assert ( screenMock ) ;
13
+ ScreenClass . prototype . find = jest . fn ( ( ) => Promise . resolve ( new Region ( 0 , 0 , 100 , 100 ) ) ) ;
14
+ const screenMock = new ScreenClass ( new VisionAdapter ( ) ) ;
15
+ const SUT = new AssertClass ( screenMock ) ;
16
16
const needle = "foo" ;
17
17
18
18
// WHEN
@@ -23,9 +23,9 @@ describe("Assert", () => {
23
23
24
24
it ( "isVisible should throw if a match is found." , async ( ) => {
25
25
// GIVEN
26
- Screen . prototype . find = jest . fn ( ( ) => Promise . reject ( "foo" ) ) ;
27
- const screenMock = new Screen ( new VisionAdapter ( ) ) ;
28
- const SUT = new Assert ( screenMock ) ;
26
+ ScreenClass . prototype . find = jest . fn ( ( ) => Promise . reject ( "foo" ) ) ;
27
+ const screenMock = new ScreenClass ( new VisionAdapter ( ) ) ;
28
+ const SUT = new AssertClass ( screenMock ) ;
29
29
const needle = "foo" ;
30
30
31
31
// WHEN
@@ -36,9 +36,9 @@ describe("Assert", () => {
36
36
37
37
it ( "isVisible should throw if a match is found." , async ( ) => {
38
38
// GIVEN
39
- Screen . prototype . find = jest . fn ( ( ) => Promise . reject ( "foo" ) ) ;
40
- const screenMock = new Screen ( new VisionAdapter ( ) ) ;
41
- const SUT = new Assert ( screenMock ) ;
39
+ ScreenClass . prototype . find = jest . fn ( ( ) => Promise . reject ( "foo" ) ) ;
40
+ const screenMock = new ScreenClass ( new VisionAdapter ( ) ) ;
41
+ const SUT = new AssertClass ( screenMock ) ;
42
42
const searchRegion = new Region ( 10 , 10 , 10 , 10 ) ;
43
43
const needle = "foo" ;
44
44
@@ -53,9 +53,9 @@ describe("Assert", () => {
53
53
54
54
it ( "isNotVisible should throw if a match is found." , async ( ) => {
55
55
// GIVEN
56
- Screen . prototype . find = jest . fn ( ( ) => Promise . resolve ( new Region ( 0 , 0 , 100 , 100 ) ) ) ;
57
- const screenMock = new Screen ( new VisionAdapter ( ) ) ;
58
- const SUT = new Assert ( screenMock ) ;
56
+ ScreenClass . prototype . find = jest . fn ( ( ) => Promise . resolve ( new Region ( 0 , 0 , 100 , 100 ) ) ) ;
57
+ const screenMock = new ScreenClass ( new VisionAdapter ( ) ) ;
58
+ const SUT = new AssertClass ( screenMock ) ;
59
59
const needle = "foo" ;
60
60
61
61
// WHEN
@@ -66,9 +66,9 @@ describe("Assert", () => {
66
66
67
67
it ( "isVisible should throw if a match is found." , async ( ) => {
68
68
// GIVEN
69
- Screen . prototype . find = jest . fn ( ( ) => Promise . reject ( "foo" ) ) ;
70
- const screenMock = new Screen ( new VisionAdapter ( ) ) ;
71
- const SUT = new Assert ( screenMock ) ;
69
+ ScreenClass . prototype . find = jest . fn ( ( ) => Promise . reject ( "foo" ) ) ;
70
+ const screenMock = new ScreenClass ( new VisionAdapter ( ) ) ;
71
+ const SUT = new AssertClass ( screenMock ) ;
72
72
const needle = "foo" ;
73
73
74
74
// WHEN
0 commit comments