@@ -25,7 +25,7 @@ test("contact email is available in public footers, feedback, help, and the work
2525 const address = "[email protected] " ; 2626 for ( const path of [ "/" , "/contact" , "/credits" ] ) {
2727 await page . goto ( `${ dev } ${ path } ` ) ;
28- await expect ( page . getByRole ( "navigation" , { name : "Footer" , exact : true } ) . getByRole ( "link" , { name : address , exact : true } ) ) . toHaveAttribute ( "href" , `mailto:${ address } ` ) ;
28+ await expect ( page . getByRole ( "navigation" , { name : "Footer" , exact : true } ) . getByRole ( "link" , { name : "Email us" , exact : true } ) ) . toHaveAttribute ( "href" , `mailto:${ address } ` ) ;
2929 expect ( await page . evaluate ( ( ) => document . documentElement . scrollWidth - innerWidth ) ) . toBeLessThanOrEqual ( 1 ) ;
3030 }
3131 await openFeedback ( page ) ;
@@ -83,7 +83,7 @@ test("offline and failed sends retain text and retry the same reference before s
8383 expect ( requests ) . toHaveLength ( 0 ) ;
8484 await context . setOffline ( false ) ;
8585 await page . getByRole ( "button" , { name : "Send message" , exact : true } ) . click ( ) ;
86- await expect ( page . getByRole ( "alert" ) ) . toContainText ( "couldn 't confirm " ) ;
86+ await expect ( page . getByRole ( "alert" ) ) . toContainText ( "contact service isn 't responding " ) ;
8787 await expect ( page . getByRole ( "textbox" , { name : "Message" , exact : true } ) ) . toHaveValue ( "Synthetic test content. No real email is sent." ) ;
8888 await page . getByRole ( "button" , { name : "Check delivery" , exact : true } ) . click ( ) ;
8989 await expect ( page . getByRole ( "heading" , { name : "Message sent" } ) ) . toBeVisible ( ) ;
@@ -135,7 +135,7 @@ test("unconfirmed, rate-limited, and invalid success responses never lose the dr
135135 ] ;
136136 await route . fulfill ( { ...responses [ references . length - 1 ] , headers : { "Access-Control-Allow-Origin" : dev } } ) ;
137137 } ) ;
138- for ( const message of [ "couldn't confirm " , "haven't confirmed" , "Too many attempts" , "couldn't confirm " ] ) {
138+ for ( const message of [ "couldn't send this " , "haven't confirmed" , "Too many attempts" , "couldn't send this " ] ) {
139139 await page . getByRole ( "button" , { name : / ^ ( S e n d m e s s a g e | C h e c k d e l i v e r y ) $ / } ) . click ( ) ;
140140 await expect ( page . getByRole ( "alert" ) ) . toContainText ( message ) ;
141141 await expect ( page . getByRole ( "heading" , { name : "Message sent" } ) ) . not . toBeVisible ( ) ;
@@ -196,8 +196,10 @@ test("topics follow the reason, preserve shared choices, and submit the matching
196196 await page . emulateMedia ( { reducedMotion : "reduce" } ) ;
197197 await page . goto ( `${ dev } /contact` ) ;
198198 await fillMessage ( page ) ;
199- const reason = page . getByRole ( "button" , { name : "Reason" , exact : true } ) ;
200- const topic = page . getByRole ( "button" , { name : "Topic" , exact : true } ) ;
199+ const reason = page . getByRole ( "button" , { name : / ^ R e a s o n / } ) ;
200+ const topic = page . getByRole ( "button" , { name : / ^ T o p i c / } ) ;
201+ await expect ( reason ) . toHaveAccessibleName ( "Reason General feedback" ) ;
202+ await expect ( topic ) . toHaveAccessibleName ( "Topic Drowse in general" ) ;
201203 async function chooseReason ( label : string ) {
202204 await reason . click ( ) ;
203205 await page . getByRole ( "option" , { name : label , exact : true } ) . click ( ) ;
@@ -223,10 +225,15 @@ test("topics follow the reason, preserve shared choices, and submit the matching
223225 expect ( await topicLabels ( ) ) . toEqual ( [ "Interview request" , "Coverage and fact checking" , "Images and press materials" , "Something else" ] ) ;
224226 await chooseReason ( "Research and collaboration" ) ;
225227 await expect ( topic ) . toContainText ( "Research collaboration" ) ;
226- expect ( await topicLabels ( ) ) . toEqual ( [ "Research collaboration" , "Using Drowse in a study" , "Methods and validation" , "Sharing results" , "Funding & Sponsorship " , "Something else" ] ) ;
228+ expect ( await topicLabels ( ) ) . toEqual ( [ "Research collaboration" , "Using Drowse in a study" , "Methods and validation" , "Sharing results" , "Grants and research funding " , "Something else" ] ) ;
227229 await topic . click ( ) ;
228- await page . getByRole ( "option" , { name : "Funding & Sponsorship" , exact : true } ) . click ( ) ;
229- await expect ( topic ) . toContainText ( "Funding & Sponsorship" ) ;
230+ await page . getByRole ( "option" , { name : "Grants and research funding" , exact : true } ) . click ( ) ;
231+ await chooseReason ( "Funding and sponsorship" ) ;
232+ await expect ( topic ) . toContainText ( "Grants and research funding" ) ;
233+ expect ( await topicLabels ( ) ) . toEqual ( [ "Sponsoring Drowse" , "Grants and research funding" , "Something else" ] ) ;
234+ await chooseReason ( "Teaching with Drowse" ) ;
235+ await expect ( topic ) . toContainText ( "Using Drowse in a course" ) ;
236+ expect ( await topicLabels ( ) ) . toEqual ( [ "Using Drowse in a course" , "Teaching materials" , "Something else" ] ) ;
230237 await topic . click ( ) ;
231238 await page . getByRole ( "option" , { name : "Something else" , exact : true } ) . click ( ) ;
232239 await chooseReason ( "Media and press" ) ;
@@ -295,7 +302,7 @@ for (const viewportWidth of [390, 1280]) {
295302 await page . setViewportSize ( { width : viewportWidth , height : 720 } ) ;
296303 await page . emulateMedia ( { reducedMotion : "no-preference" } ) ;
297304 await page . goto ( `${ dev } /contact` ) ;
298- const field = page . getByRole ( "button" , { name : " Reason" , exact : true } ) ;
305+ const field = page . getByRole ( "button" , { name : / ^ R e a s o n / } ) ;
299306 await field . click ( { delay : 160 } ) ;
300307 const list = page . getByRole ( "listbox" , { name : "Reason" , exact : true } ) ;
301308 await expect ( list ) . toHaveCSS ( "transform" , "matrix(1, 0, 0, 1, 0, 0)" ) ;
0 commit comments