1- import { test } from 'vitest' ;
21import assert from 'node:assert/strict' ;
2+ import { test } from 'vitest' ;
33import {
44 findBestMatchesByLocator ,
55 normalizeRole ,
@@ -21,10 +21,16 @@ test('public finders entrypoint re-exports pure helpers', () => {
2121 const nodes : SnapshotNode [ ] = [ makeNode ( 'e1' , 'Continue' ) ] ;
2222
2323 const parsed = parseFindArgs ( [ 'label' , 'Continue' , 'click' ] ) ;
24- const best = findBestMatchesByLocator ( nodes , 'label' , 'Continue' , true ) ;
24+ const best = findBestMatchesByLocator ( nodes , 'label' , 'Continue' ) ;
25+ const requireRectLegacy = findBestMatchesByLocator ( nodes , 'label' , 'Continue' , true ) ;
26+ const requireRectOptions = findBestMatchesByLocator ( nodes , 'label' , 'Continue' , {
27+ requireRect : true ,
28+ } ) ;
2529
2630 assert . equal ( normalizeText ( ' Continue\nNow ' ) , 'continue now' ) ;
2731 assert . equal ( normalizeRole ( 'XCUIElementTypeApplication.XCUIElementTypeButton' ) , 'button' ) ;
2832 assert . equal ( parsed . action , 'click' ) ;
29- assert . equal ( best . matches . length , 0 ) ;
33+ assert . equal ( best . matches . length , 1 ) ;
34+ assert . equal ( requireRectLegacy . matches . length , 0 ) ;
35+ assert . equal ( requireRectOptions . matches . length , 0 ) ;
3036} ) ;
0 commit comments