w3c / aria-at-automation-driver

A WebSocket server which allows clients to observe the text enunciated by a screen reader and to simulate user input
Other
10 stars 6 forks source link

Fix 'rejects invalid pressKey' test #35

Closed mzgoddard closed 9 months ago

mzgoddard commented 10 months ago

The test rejects invalid "pressKey" currently fails. The underlying behaviour does not return the expected message but a different one. Fix the message to what the current behaviour returns.

jugglinmike commented 9 months ago

@mzgoddard on my machine, this test passes in main and fails with this patch applied. I see that you observed a test failure in gh-34, but because there aren't any CI logs which demonstrate it, I don't have any ideas about what could be causing the discrepancy.

The test on the main branch matches my intuitive understanding of the code, so I'll share that to help us get to the bottom of this. By my reading, the message "unknown key" is only used when the "key" includes a character in the range [\ue000-\ue05d]. The test specifies the key as the string "df daf% ?". While clearly invalid as a "key", the string doesn't include any character in that range (those spaces are U+0020), so it should be tolerated. The expected error occurs when this complete string is passed to the keyToggle method provided by RobotJS.

Does that make sense to you?

mzgoddard commented 9 months ago

Yeah. I see the mistake I made in trying to understand the error. I couldn't find the line in lib making the error message. And I overlooked it being an error produced by robotjs. Gonna close this and update one of the error messages in #37 to pass this test.