File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -161,6 +161,30 @@ describe("Screen.", () => {
161
161
expect ( visionAdapterMock . findOnScreenRegion ) . toHaveBeenCalledWith ( expectedMatchRequest ) ;
162
162
} ) ;
163
163
164
+ it ( "should override searchMultipleScales with parameter." , async ( ) => {
165
+ // GIVEN
166
+ const matchResult = new MatchResult ( 0.99 , searchRegion ) ;
167
+ VisionAdapter . prototype . findOnScreenRegion = jest . fn ( ( ) => {
168
+ return Promise . resolve ( matchResult ) ;
169
+ } ) ;
170
+ const visionAdapterMock = new VisionAdapter ( ) ;
171
+ const SUT = new Screen ( visionAdapterMock ) ;
172
+ const imagePath = "test/path/to/image.png" ;
173
+ const parameters = new LocationParameters ( searchRegion , undefined , false ) ;
174
+ const expectedMatchRequest = new MatchRequest (
175
+ expect . any ( Image ) ,
176
+ join ( cwd ( ) , imagePath ) ,
177
+ searchRegion ,
178
+ SUT . config . confidence ,
179
+ false ) ;
180
+
181
+ // WHEN
182
+ await SUT . find ( imagePath , parameters ) ;
183
+
184
+ // THEN
185
+ expect ( visionAdapterMock . findOnScreenRegion ) . toHaveBeenCalledWith ( expectedMatchRequest ) ;
186
+ } ) ;
187
+
164
188
it ( "should override both confidence and search region with parameter." , async ( ) => {
165
189
// GIVEN
166
190
const minMatch = 0.8 ;
You can’t perform that action at this time.
0 commit comments