@@ -41,11 +41,7 @@ function createMockElement(tag: string, attrs: Record<string, string>, text = ''
4141
4242describe ( 'annotatePageElements' , ( ) => {
4343 it ( 'parses ARIA snapshot and returns elements with roles' , async ( ) => {
44- const ariaSnapshot = [
45- '- button "Submit" [ref=e1]' ,
46- '- link "Home" [ref=e2]' ,
47- '- textbox "Email" [ref=e3]' ,
48- ] . join ( '\n' ) ;
44+ const ariaSnapshot = [ '- button "Submit" [ref=e1]' , '- link "Home" [ref=e2]' , '- textbox "Email" [ref=e3]' ] . join ( '\n' ) ;
4945
5046 const page = createMockPage ( ariaSnapshot , {
5147 button : [ createMockElement ( 'button' , { type : 'submit' } , 'Submit' ) ] ,
@@ -63,16 +59,10 @@ describe('annotatePageElements', () => {
6359 } ) ;
6460
6561 it ( 'handles multiple elements of the same role' , async ( ) => {
66- const ariaSnapshot = [
67- '- button "Save" [ref=e1]' ,
68- '- button "Cancel" [ref=e2]' ,
69- ] . join ( '\n' ) ;
62+ const ariaSnapshot = [ '- button "Save" [ref=e1]' , '- button "Cancel" [ref=e2]' ] . join ( '\n' ) ;
7063
7164 const page = createMockPage ( ariaSnapshot , {
72- button : [
73- createMockElement ( 'button' , { } , 'Save' ) ,
74- createMockElement ( 'button' , { } , 'Cancel' ) ,
75- ] ,
65+ button : [ createMockElement ( 'button' , { } , 'Save' ) , createMockElement ( 'button' , { } , 'Cancel' ) ] ,
7666 } ) ;
7767
7868 const result = await annotatePageElements ( page ) ;
@@ -83,11 +73,7 @@ describe('annotatePageElements', () => {
8373 } ) ;
8474
8575 it ( 'skips non-annotatable roles' , async ( ) => {
86- const ariaSnapshot = [
87- '- heading "Title" [ref=e1]' ,
88- '- button "OK" [ref=e2]' ,
89- '- paragraph "text" [ref=e3]' ,
90- ] . join ( '\n' ) ;
76+ const ariaSnapshot = [ '- heading "Title" [ref=e1]' , '- button "OK" [ref=e2]' , '- paragraph "text" [ref=e3]' ] . join ( '\n' ) ;
9177
9278 const page = createMockPage ( ariaSnapshot , {
9379 button : [ createMockElement ( 'button' , { } , 'OK' ) ] ,
@@ -108,16 +94,7 @@ describe('annotatePageElements', () => {
10894 } ) ;
10995
11096 it ( 'handles all annotatable roles' , async ( ) => {
111- const ariaSnapshot = [
112- '- button "Btn" [ref=e1]' ,
113- '- link "Lnk" [ref=e2]' ,
114- '- checkbox "Chk" [ref=e3]' ,
115- '- radio "Rad" [ref=e4]' ,
116- '- combobox "Cmb" [ref=e5]' ,
117- '- tab "Tab1" [ref=e6]' ,
118- '- menuitem "Menu" [ref=e7]' ,
119- '- switch "Sw" [ref=e8]' ,
120- ] . join ( '\n' ) ;
97+ const ariaSnapshot = [ '- button "Btn" [ref=e1]' , '- link "Lnk" [ref=e2]' , '- checkbox "Chk" [ref=e3]' , '- radio "Rad" [ref=e4]' , '- combobox "Cmb" [ref=e5]' , '- tab "Tab1" [ref=e6]' , '- menuitem "Menu" [ref=e7]' , '- switch "Sw" [ref=e8]' ] . join ( '\n' ) ;
12198
12299 const page = createMockPage ( ariaSnapshot , {
123100 button : [ createMockElement ( 'button' , { } , 'Btn' ) ] ,
0 commit comments