Skip to content
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

Unexpected behavior note #802

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 33 additions & 24 deletions tests/resources/aria-at-harness.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ function renderVirtualInstructionDocument(doc) {
type('checkbox'),
value(failOption.description),
id(`${failOption.description}-${commandIndex}`),
className([`undesirable-${commandIndex}`]),
className([`unexpected-${commandIndex}`]),
tabIndex(failOption.tabbable ? '0' : '-1'),
disabled(!failOption.enabled),
checked(failOption.checked),
Expand All @@ -436,28 +436,26 @@ function renderVirtualInstructionDocument(doc) {
forInput(`${failOption.description}-${commandIndex}`),
rich(failOption.description)
),
br(),
failOption.more
? div(
label(
forInput(`${failOption.description}-${commandIndex}-input`),
rich(failOption.more.description)
),
input(
type('text'),
id(`${failOption.description}-${commandIndex}-input`),
name(`${failOption.description}-${commandIndex}-input`),
className(['undesirable-other-input']),
disabled(!failOption.more.enabled),
value(failOption.more.value),
onchange(ev =>
failOption.more.change(
/** @type {HTMLInputElement} */ (ev.currentTarget).value
)
)
)
br()
)
),
fragment(
// TODO: Figure out why this isn't appearing
div(
label(forInput('unexpected-behavior-note'), rich('Add an explanation')),
input(
type('text'),
id('unexpected-behavior-note'),
name('unexpected-behavior-note'),
className(['unexpected-behavior-note']),
value(unexpected.failChoice.note.value),
disabled(!unexpected.failChoice.note.enabled),
onchange(ev =>
unexpected.failChoice.note.change(
/** @type {HTMLInputElement} */ (ev.currentTarget).value
)
: fragment()
)
)
)
)
)
Expand Down Expand Up @@ -592,9 +590,20 @@ function renderVirtualResultsTable(results) {
* @param {object} list
* @param {Description} list.description
* @param {Description[]} list.items
* @param {String} [list.note]
*/
function commandDetailsList({ description, items }) {
return div(description, ul(...items.map(description => li(rich(description)))));
function commandDetailsList({
description,
items,
note: { value: noteValue = '', description: noteDescription } = {},
}) {
return div(
description,
ul(
...items.map(description => li(rich(description))),
noteValue.length ? li(rich(noteDescription), ' ', em(noteValue)) : fragment()
)
);
}
}

Expand Down
22 changes: 12 additions & 10 deletions tests/resources/aria-at-test-io-format.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class KeysInput {
modeInstructions: {
reading: {
jaws: `Verify the Virtual Cursor is active by pressing ${keys.ALT_DELETE}. If it is not, exit Forms Mode to activate the Virtual Cursor by pressing ${keys.ESC}.`,
nvda: `Ensure NVDA is in browse mode by pressing ${keys.ESC}. Note: This command has no effect if NVDA is already in browse mode.`,
nvda: `Insure NVDA is in browse mode by pressing ${keys.ESC}. Note: This command has no effect if NVDA is already in browse mode.`,
voiceover_macos: `Toggle Quick Nav ON by pressing the ${keys.LEFT} and ${keys.RIGHT} keys at the same time.`,
}[atKey],
interaction: {
Expand Down Expand Up @@ -917,8 +917,12 @@ export class TestRunInputOutput {
behaviors: test.unexpectedBehaviors.map(({ description, requireExplanation }) => ({
description,
checked: false,
more: requireExplanation ? { highlightRequired: false, value: '' } : null,
requireExplanation,
})),
note: {
highlightRequired: false,
value: '',
},
},
})
),
Expand Down Expand Up @@ -1009,7 +1013,7 @@ export class TestRunInputOutput {
),
unexpected_behaviors: command.unexpected.behaviors
.filter(({ checked }) => checked)
.map(({ description, more }) => (more ? more.value : description)),
.map(({ description }) => description),
})),
};

Expand Down Expand Up @@ -1125,11 +1129,11 @@ export class TestRunInputOutput {
behavior.checked
? {
text: behavior.description,
otherUnexpectedBehaviorText: behavior.more ? behavior.more.value : null,
}
: null
)
.filter(Boolean),
unexpectedBehaviorNote: command.unexpected.note.value || null,
})),
};
}
Expand Down Expand Up @@ -1194,14 +1198,12 @@ export class TestRunInputOutput {
return {
...behavior,
checked: behaviorResult ? true : false,
more: behavior.more
? {
highlightRequired: false,
value: behaviorResult ? behaviorResult.otherUnexpectedBehaviorText : '',
}
: behavior.more,
};
}),
note: {
highlightRequired: false,
value: scenarioResult.unexpectedBehaviorNote || '',
},
},
};
}),
Expand Down
Loading