1- import { NativeAdapter } from "./adapter/native.adapter.class" ;
21import { VisionAdapter } from "./adapter/vision.adapter.class" ;
32import { Assert } from "./assert.class" ;
43import { Region } from "./region.class" ;
@@ -11,23 +10,23 @@ jest.mock("./screen.class");
1110describe ( "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