-
Notifications
You must be signed in to change notification settings - Fork 33
Support multiple settings being defined in *-commands.csv
#1125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 7 commits
29e33f8
49b0924
af94498
57f2343
542256a
51cd2bc
cbcaa0b
5e515a6
ea61658
94156f7
8cc3a75
03fc960
ca07c83
5a3bf63
6cf4165
d124159
c5835de
d1a220d
e5f78ed
d3e5b14
42ef8ff
093a2e2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -149,8 +149,9 @@ function parseTestCSVRowV2({ tests, assertions, scripts, commands }) { | |
| } | ||
|
|
||
| // Also account for 'modeless' AT configurations with 'defaultMode' | ||
| // TODO: Account for a list of settings as described by https://github.com/w3c/aria-at/wiki/Test-Format-Definition-V2#settings | ||
| const settingsValue = command.settings || 'defaultMode'; | ||
| const [primarySetting, ...additionalSettings] = command.settings | ||
| ? command.settings.split(' ') | ||
| : ['defaultMode']; | ||
|
|
||
| if (isEmptyObject(testsParsed[arrPosition])) { | ||
| testsParsed[arrPosition] = { | ||
|
|
@@ -162,7 +163,7 @@ function parseTestCSVRowV2({ tests, assertions, scripts, commands }) { | |
| ats: [ | ||
| { | ||
| ...atTargetInfo, | ||
| settings: settingsValue, | ||
| settings: primarySetting, | ||
| }, | ||
| ], | ||
| }, | ||
|
|
@@ -178,12 +179,12 @@ function parseTestCSVRowV2({ tests, assertions, scripts, commands }) { | |
| } else { | ||
| if ( | ||
| !testsParsed[arrPosition].target.ats.find( | ||
| e => e.key === atTargetInfo.key && e.settings === settingsValue | ||
| e => e.key === atTargetInfo.key && e.settings === primarySetting | ||
| ) | ||
| ) | ||
| testsParsed[arrPosition].target.ats.push({ | ||
| ...atTargetInfo, | ||
| settings: settingsValue, | ||
| settings: primarySetting, | ||
| }); | ||
| } | ||
| } | ||
|
|
@@ -203,25 +204,28 @@ function parseTestCSVRowV2({ tests, assertions, scripts, commands }) { | |
| return ( | ||
| testId === commandInfo.testId && | ||
| command === commandInfo.command && | ||
| settings === commandInfo.settings && | ||
| settings === commandInfo.settings && // the primary settings value | ||
| presentationNumber === commandInfo.presentationNumber | ||
| ); | ||
| } | ||
|
|
||
| for (const command of commands) { | ||
| testsParsed.forEach(test => { | ||
| const [primarySetting, ...additionalSettings] = command.settings | ||
| ? command.settings.split(' ') | ||
| : ['defaultMode']; | ||
|
|
||
| if ( | ||
| command.testId === test.testId && | ||
| test.target.ats.some( | ||
| at => at.key === key && at.settings === (command.settings || 'defaultMode') | ||
| ) | ||
| test.target.ats.some(at => at.key === key && at.settings === primarySetting) | ||
| ) { | ||
| const commandInfo = { | ||
| testId: command.testId, | ||
| command: command.command, | ||
| settings: command.settings || 'defaultMode', | ||
| settings: primarySetting, | ||
|
||
| presentationNumber: Number(command.presentationNumber), | ||
| assertionExceptions: command.assertionExceptions, | ||
| additionalSettings, | ||
| }; | ||
|
|
||
| // Test level commandInfo, useful for getting assertionExceptions and | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This structure with the primary setting as the first item in a space-separated collection feels a bit fragile. I'd rather have this as a distinct column. It feels like there is significance not surfaced by a quick read of the input. I assume that this is a design decision towards a better authoring experience so I support leaving as-is for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Relevant to my reply here, I agree with that point. I've reverted this approach