Skip to content

Commit

Permalink
fix: handling of commands.json aliases (#1197)
Browse files Browse the repository at this point in the history
* Reusable commands.json handler; default flattenObject parentKey attribute

* Match JSDocs

* Match functions

* Fix function export

* Update tests to check for key aliases
  • Loading branch information
howard-e authored Feb 13, 2025
1 parent bac64bf commit fabc5ea
Show file tree
Hide file tree
Showing 6 changed files with 360 additions and 357 deletions.
2 changes: 1 addition & 1 deletion __test__/__mocks__/tests/alert/data/jaws-commands.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ testId,command,settings,assertionExceptions,presentationNumber
triggerAlert,space,virtualCursor,,1.0
triggerAlert,enter,virtualCursor,,1.1
triggerAlert,space,pcCursor,,2.0
triggerAlert,enter,pcCursor,,2.1
triggerAlert,jaws nvda vo del delete esc escape jaws+space nvda+space vo+space,pcCursor,,2.1
112 changes: 96 additions & 16 deletions __test__/__snapshots__/createAllTests.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -10970,7 +10970,9 @@ exports[`V2 test format version runs createAllTests successfully (alert) 1`] = `
"pcCursor": {
"jaws": [
[ "space|2" ],
[ "enter|2.1" ]
[
"jaws nvda vo del delete esc escape jaws+space nvda+space vo+space|2.1"
]
]
},
"browseMode": {
Expand Down Expand Up @@ -11328,15 +11330,51 @@ exports[`V2 test format version runs createAllTests successfully (alert) 6`] = `
"settings": "pcCursor"
},
{
"id": "enter",
"id": "jaws nvda vo del delete esc escape jaws+space nvda+space vo+space",
"keypresses": [
{
"id": "enter",
"keystroke": "Enter"
"id": "jaws",
"keystroke": "Insert"
},
{
"id": "nvda",
"keystroke": "Insert"
},
{
"id": "vo",
"keystroke": "Control+Option"
},
{
"id": "del",
"keystroke": "Delete"
},
{
"id": "delete",
"keystroke": "Delete"
},
{
"id": "esc",
"keystroke": "Escape"
},
{
"id": "escape",
"keystroke": "Escape"
},
{
"id": "jaws+space",
"keystroke": "Insert+Space"
},
{
"id": "nvda+space",
"keystroke": "Insert+Space"
},
{
"id": "vo+space",
"keystroke": "Control+Option+Space"
}
],
"assertionExceptions": [],
"keystroke": "Enter",
"keystroke": "Insert then Insert then Control+Option then Delete then Delete then Escape then Escape then Insert+Space then Insert+Space then Control+Option+Space",
"presentationNumber": 2.1,
"settings": "pcCursor"
}
Expand Down Expand Up @@ -11997,7 +12035,7 @@ exports[`V2 test format version runs createAllTests successfully (alert) 11`] =
},
{
"testId": "triggerAlert",
"command": "enter",
"command": "jaws nvda vo del delete esc escape jaws+space nvda+space vo+space",
"settings": "pcCursor",
"presentationNumber": 2.1,
"assertionExceptions": ""
Expand Down Expand Up @@ -12069,7 +12107,9 @@ exports[`V2 test format version runs createAllTests successfully (alert) 11`] =
"pcCursor": {
"jaws": [
[ "space|2" ],
[ "enter|2.1" ]
[
"jaws nvda vo del delete esc escape jaws+space nvda+space vo+space|2.1"
]
]
},
"browseMode": {
Expand Down Expand Up @@ -12166,7 +12206,7 @@ exports[`V2 test format version runs createAllTests successfully (alert) 12`] =
},
{
"testId": "triggerAlert",
"command": "enter",
"command": "jaws nvda vo del delete esc escape jaws+space nvda+space vo+space",
"settings": "pcCursor",
"presentationNumber": 2.1,
"assertionExceptions": ""
Expand Down Expand Up @@ -26209,7 +26249,9 @@ exports[`all test format versions runs createAllTests successfully 1`] = `
"pcCursor": {
"jaws": [
[ "space|2" ],
[ "enter|2.1" ]
[
"jaws nvda vo del delete esc escape jaws+space nvda+space vo+space|2.1"
]
]
},
"browseMode": {
Expand Down Expand Up @@ -26567,15 +26609,51 @@ exports[`all test format versions runs createAllTests successfully 6`] = `
"settings": "pcCursor"
},
{
"id": "enter",
"id": "jaws nvda vo del delete esc escape jaws+space nvda+space vo+space",
"keypresses": [
{
"id": "enter",
"keystroke": "Enter"
"id": "jaws",
"keystroke": "Insert"
},
{
"id": "nvda",
"keystroke": "Insert"
},
{
"id": "vo",
"keystroke": "Control+Option"
},
{
"id": "del",
"keystroke": "Delete"
},
{
"id": "delete",
"keystroke": "Delete"
},
{
"id": "esc",
"keystroke": "Escape"
},
{
"id": "escape",
"keystroke": "Escape"
},
{
"id": "jaws+space",
"keystroke": "Insert+Space"
},
{
"id": "nvda+space",
"keystroke": "Insert+Space"
},
{
"id": "vo+space",
"keystroke": "Control+Option+Space"
}
],
"assertionExceptions": [],
"keystroke": "Enter",
"keystroke": "Insert then Insert then Control+Option then Delete then Delete then Escape then Escape then Insert+Space then Insert+Space then Control+Option+Space",
"presentationNumber": 2.1,
"settings": "pcCursor"
}
Expand Down Expand Up @@ -27236,7 +27314,7 @@ exports[`all test format versions runs createAllTests successfully 11`] = `
},
{
"testId": "triggerAlert",
"command": "enter",
"command": "jaws nvda vo del delete esc escape jaws+space nvda+space vo+space",
"settings": "pcCursor",
"presentationNumber": 2.1,
"assertionExceptions": ""
Expand Down Expand Up @@ -27308,7 +27386,9 @@ exports[`all test format versions runs createAllTests successfully 11`] = `
"pcCursor": {
"jaws": [
[ "space|2" ],
[ "enter|2.1" ]
[
"jaws nvda vo del delete esc escape jaws+space nvda+space vo+space|2.1"
]
]
},
"browseMode": {
Expand Down Expand Up @@ -27405,7 +27485,7 @@ exports[`all test format versions runs createAllTests successfully 12`] = `
},
{
"testId": "triggerAlert",
"command": "enter",
"command": "jaws nvda vo del delete esc escape jaws+space nvda+space vo+space",
"settings": "pcCursor",
"presentationNumber": 2.1,
"assertionExceptions": ""
Expand Down
20 changes: 10 additions & 10 deletions __test__/__snapshots__/createReviewPages.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ exports[`review pages creation runs createReviewPages successfully for all test
<li>Space (virtual cursor active)</li>
<li>Enter (virtual cursor active)</li>
<li>Space (PC cursor active)</li>
<li>Enter (PC cursor active)</li>
<li>Insert then Insert then Control+Option then Delete then Delete then Escape then Escape then Insert+Space then Insert+Space then Control+Option+Space (PC cursor active)</li>
</ul>
</li>
</ol>
Expand Down Expand Up @@ -353,7 +353,7 @@ exports[`review pages creation runs createReviewPages successfully for all test
<td>Text &#39;Hello&#39; is conveyed</td>
</tr>
</table>
<h4 id="t1-jaws-c4">Enter (PC cursor active): 1 MUST, 0 SHOULD, AND 1 MAY assertions</h4>
<h4 id="t1-jaws-c4">Insert then Insert then Control+Option then Delete then Delete then Escape then Escape then Insert+Space then Insert+Space then Control+Option+Space (PC cursor active): 1 MUST, 0 SHOULD, AND 1 MAY assertions</h4>
<table aria-labelledby="t1-jaws-c4">
<tr>
<th>Priority</th>
Expand Down Expand Up @@ -7419,7 +7419,7 @@ exports[`review pages creation runs createReviewPages successfully for all test
<li>Space (virtual cursor active)</li>
<li>Enter (virtual cursor active)</li>
<li>Space (PC cursor active)</li>
<li>Enter (PC cursor active)</li>
<li>Insert then Insert then Control+Option then Delete then Delete then Escape then Escape then Insert+Space then Insert+Space then Control+Option+Space (PC cursor active)</li>
</ul>
</li>
</ol>
Expand Down Expand Up @@ -7487,7 +7487,7 @@ exports[`review pages creation runs createReviewPages successfully for all test
<td>Text &#39;Hello&#39; is conveyed</td>
</tr>
</table>
<h4 id="t1-jaws-c4">Enter (PC cursor active): 1 MUST, 0 SHOULD, AND 1 MAY assertions</h4>
<h4 id="t1-jaws-c4">Insert then Insert then Control+Option then Delete then Delete then Escape then Escape then Insert+Space then Insert+Space then Control+Option+Space (PC cursor active): 1 MUST, 0 SHOULD, AND 1 MAY assertions</h4>
<table aria-labelledby="t1-jaws-c4">
<tr>
<th>Priority</th>
Expand Down Expand Up @@ -14553,7 +14553,7 @@ exports[`review pages creation runs createReviewPages successfully for all test
<li>Space (virtual cursor active)</li>
<li>Enter (virtual cursor active)</li>
<li>Space (PC cursor active)</li>
<li>Enter (PC cursor active)</li>
<li>Insert then Insert then Control+Option then Delete then Delete then Escape then Escape then Insert+Space then Insert+Space then Control+Option+Space (PC cursor active)</li>
</ul>
</li>
</ol>
Expand Down Expand Up @@ -14621,7 +14621,7 @@ exports[`review pages creation runs createReviewPages successfully for all test
<td>Text &#39;Hello&#39; is conveyed</td>
</tr>
</table>
<h4 id="t1-jaws-c4">Enter (PC cursor active): 1 MUST, 0 SHOULD, AND 1 MAY assertions</h4>
<h4 id="t1-jaws-c4">Insert then Insert then Control+Option then Delete then Delete then Escape then Escape then Insert+Space then Insert+Space then Control+Option+Space (PC cursor active): 1 MUST, 0 SHOULD, AND 1 MAY assertions</h4>
<table aria-labelledby="t1-jaws-c4">
<tr>
<th>Priority</th>
Expand Down Expand Up @@ -21687,7 +21687,7 @@ exports[`review pages creation runs createReviewPages successfully for all test
<li>Space (virtual cursor active)</li>
<li>Enter (virtual cursor active)</li>
<li>Space (PC cursor active)</li>
<li>Enter (PC cursor active)</li>
<li>Insert then Insert then Control+Option then Delete then Delete then Escape then Escape then Insert+Space then Insert+Space then Control+Option+Space (PC cursor active)</li>
</ul>
</li>
</ol>
Expand Down Expand Up @@ -21755,7 +21755,7 @@ exports[`review pages creation runs createReviewPages successfully for all test
<td>Text &#39;Hello&#39; is conveyed</td>
</tr>
</table>
<h4 id="t1-jaws-c4">Enter (PC cursor active): 1 MUST, 0 SHOULD, AND 1 MAY assertions</h4>
<h4 id="t1-jaws-c4">Insert then Insert then Control+Option then Delete then Delete then Escape then Escape then Insert+Space then Insert+Space then Control+Option+Space (PC cursor active): 1 MUST, 0 SHOULD, AND 1 MAY assertions</h4>
<table aria-labelledby="t1-jaws-c4">
<tr>
<th>Priority</th>
Expand Down Expand Up @@ -31773,7 +31773,7 @@ exports[`review pages creation runs createReviewPages successfully for v2 tests
<li>Space (virtual cursor active)</li>
<li>Enter (virtual cursor active)</li>
<li>Space (PC cursor active)</li>
<li>Enter (PC cursor active)</li>
<li>Insert then Insert then Control+Option then Delete then Delete then Escape then Escape then Insert+Space then Insert+Space then Control+Option+Space (PC cursor active)</li>
</ul>
</li>
</ol>
Expand Down Expand Up @@ -31841,7 +31841,7 @@ exports[`review pages creation runs createReviewPages successfully for v2 tests
<td>Text &#39;Hello&#39; is conveyed</td>
</tr>
</table>
<h4 id="t1-jaws-c4">Enter (PC cursor active): 1 MUST, 0 SHOULD, AND 1 MAY assertions</h4>
<h4 id="t1-jaws-c4">Insert then Insert then Control+Option then Delete then Delete then Escape then Escape then Insert+Space then Insert+Space then Control+Option+Space (PC cursor active): 1 MUST, 0 SHOULD, AND 1 MAY assertions</h4>
<table aria-labelledby="t1-jaws-c4">
<tr>
<th>Priority</th>
Expand Down
Loading

0 comments on commit fabc5ea

Please sign in to comment.