Skip to content
Merged
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
22 changes: 11 additions & 11 deletions tests/resources/aria-at-harness.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
userCloseWindow,
userOpenWindow,
WhitespaceStyleMap,
UnexpectedBehaviorImpactMap,
NegativeSideEffectImpactMap,
} from './aria-at-test-run.mjs';
import { TestRunExport, TestRunInputOutput } from './aria-at-test-io-format.mjs';
import { TestWindow } from './aria-at-test-window.mjs';
Expand Down Expand Up @@ -438,15 +438,15 @@ function renderVirtualInstructionDocument(doc) {
)
)
),
...[command.unexpectedBehaviors].map(bind(commandResultUnexpectedBehavior, commandIndex))
...[command.negativeSideEffects].map(bind(commandResultNegativeSideEffect, commandIndex))
);
}

/**
* @param {number} commandIndex
* @param {InstructionDocumentResultsCommandsUnexpected} unexpected
*/
function commandResultUnexpectedBehavior(commandIndex, unexpected) {
function commandResultNegativeSideEffect(commandIndex, unexpected) {
return fieldset(
id(`cmd-${commandIndex}-problem`),
rich(unexpected.description),
Expand Down Expand Up @@ -474,12 +474,12 @@ function renderVirtualInstructionDocument(doc) {
.replace(/[.,]/g, '')
.replace(/\s+/g, '-');

const undesirableBehaviorCheckbox = div(
const negativeSideEffectCheckbox = div(
input(
type('checkbox'),
value(failOption.description),
id(`${failOptionId}-${commandIndex}-checkbox`),
className([`undesirable-${commandIndex}`]),
className([`negative-side-effect-${commandIndex}`]),
disabled(!failOption.enabled),
checked(failOption.checked),
focus(failOption.focus),
Expand Down Expand Up @@ -507,8 +507,8 @@ function renderVirtualInstructionDocument(doc) {
select(
id(`${failOptionId}-${commandIndex}-impact`),
ariaLabel(`Impact for ${failOption.description}`),
option(UnexpectedBehaviorImpactMap.MODERATE),
option(UnexpectedBehaviorImpactMap.SEVERE),
option(NegativeSideEffectImpactMap.MODERATE),
option(NegativeSideEffectImpactMap.SEVERE),
disabled(!failOption.checked),
onchange(ev =>
failOption.impactchange(/** @type {HTMLInputElement} */ (ev.currentTarget).value)
Expand All @@ -527,7 +527,7 @@ function renderVirtualInstructionDocument(doc) {
type('text'),
id(`${failOptionId}-${commandIndex}-details`),
ariaLabel(`Details for ${failOption.description}`),
className(['undesirable-other-input']),
className(['negative-side-effect-other-input']),
disabled(!failOption.more.enabled),
value(failOption.more.value),
onchange(ev =>
Expand All @@ -538,7 +538,7 @@ function renderVirtualInstructionDocument(doc) {

return div(
className(['problem-option-container', failOption.checked && 'enabled']),
undesirableBehaviorCheckbox,
negativeSideEffectCheckbox,
impactSelect,
detailsTextInput
);
Expand Down Expand Up @@ -615,7 +615,7 @@ function renderVirtualResultsTable(results) {
({
description,
support,
details: { output, passingAssertions, failingAssertions, unexpectedBehaviors },
details: { output, passingAssertions, failingAssertions, negativeSideEffects },
}) =>
fragment(
tr(
Expand All @@ -625,7 +625,7 @@ function renderVirtualResultsTable(results) {
p(rich(output)),
commandDetailsList(passingAssertions),
commandDetailsList(failingAssertions),
commandDetailsList(unexpectedBehaviors)
commandDetailsList(negativeSideEffects)
)
)
)
Expand Down
36 changes: 18 additions & 18 deletions tests/resources/aria-at-test-io-format.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
AssertionResultMap,
CommonResultMap,
createEnumMap,
HasUnexpectedBehaviorMap,
HasNegativeSideEffectMap,
TestRun,
UserActionMap,
} from './aria-at-test-run.mjs';
Expand Down Expand Up @@ -751,7 +751,7 @@ class BehaviorInput {
priority: Number(assertionTuple[0]),
assertion: assertionTuple[1],
})),
unexpectedBehaviors: unexpectedInput.behaviors(),
negativeSideEffects: unexpectedInput.behaviors(),
},
});
}
Expand Down Expand Up @@ -839,7 +839,7 @@ class BehaviorInput {
}
),
additionalAssertions: [],
unexpectedBehaviors: unexpectedInput.behaviors(),
negativeSideEffects: unexpectedInput.behaviors(),
},
});
}
Expand Down Expand Up @@ -1201,12 +1201,12 @@ export class TestRunInputOutput {
})),
unexpected: {
highlightRequired: false,
hasUnexpected: HasUnexpectedBehaviorMap.NOT_SET,
hasNegativeSideEffect: HasNegativeSideEffectMap.NOT_SET,
tabbedBehavior: 0,
behaviors: test.unexpectedBehaviors.map(({ description }) => ({
behaviors: test.negativeSideEffects.map(({ description }) => ({
description,
checked: false,
impact: UnexpectedBehaviorImpactMap.MODERATE,
impact: NegativeSideEffectImpactMap.MODERATE,
more: { highlightRequired: false, value: '' },
})),
},
Expand Down Expand Up @@ -1296,7 +1296,7 @@ export class TestRunInputOutput {
({ priority, result }) => priority === 3 && result !== CommonResultMap.PASS
),
},
unexpectedCount: countUnexpectedBehaviors(({ checked }) => checked),
unexpectedCount: countNegativeSideEffects(({ checked }) => checked),
},
commands: state.commands.map(command => ({
command: command.description,
Expand Down Expand Up @@ -1355,7 +1355,7 @@ export class TestRunInputOutput {
* @param {(behavior: TestRunUnexpected) => boolean} filter
* @returns {number}
*/
function countUnexpectedBehaviors(filter) {
function countNegativeSideEffects(filter) {
return state.commands.reduce(
(carry, command) => carry + command.unexpected.behaviors.filter(filter).length,
0
Expand Down Expand Up @@ -1422,7 +1422,7 @@ export class TestRunInputOutput {
? 'NO_OUTPUT'
: null,
})),
unexpectedBehaviors: command.unexpected.behaviors
negativeSideEffects: command.unexpected.behaviors
.map(behavior =>
behavior.checked
? {
Expand Down Expand Up @@ -1480,13 +1480,13 @@ export class TestRunInputOutput {
unexpected: {
...command.unexpected,
highlightRequired: false,
hasUnexpected:
scenarioResult.unexpectedBehaviors.length > 0
? 'hasUnexpected'
: 'doesNotHaveUnexpected',
hasNegativeSideEffect:
scenarioResult.negativeSideEffects.length > 0
? 'hasNegativeSideEffect'
: 'doesNotHaveNegativeSideEffect',
tabbedBehavior: 0,
behaviors: command.unexpected.behaviors.map(behavior => {
const behaviorResult = scenarioResult.unexpectedBehaviors.find(
const behaviorResult = scenarioResult.negativeSideEffects.find(
unexpectedResult => unexpectedResult.text === behavior.description
);
return {
Expand All @@ -1497,7 +1497,7 @@ export class TestRunInputOutput {
highlightRequired: false,
impact: behaviorResult
? behavior.impact
: UnexpectedBehaviorImpactMap.MODERATE,
: NegativeSideEffectImpactMap.MODERATE,
value: behaviorResult ? behaviorResult.details : '',
}
: behavior.more,
Expand Down Expand Up @@ -1583,7 +1583,7 @@ const AssertionFailJSONMap = createEnumMap({
FAIL: 'Fail',
});

const UnexpectedBehaviorImpactMap = createEnumMap({
const NegativeSideEffectImpactMap = createEnumMap({
MODERATE: 'Moderate',
SEVERE: 'Severe',
});
Expand Down Expand Up @@ -1896,7 +1896,7 @@ function findValueByKey(keysMapping, keyToFindText) {
* @property {string[]} commands
* @property {BehaviorAssertion[]} assertions
* @property {BehaviorAssertion[]} additionalAssertions
* @property {BehaviorUnexpectedItem[]} unexpectedBehaviors
* @property {BehaviorUnexpectedItem[]} negativeSideEffects
*/

/** @typedef {{[key: string]: (document: Document) => void}} SetupScripts */
Expand Down Expand Up @@ -1958,6 +1958,6 @@ function findValueByKey(keysMapping, keyToFindText) {
/** @typedef {import('./aria-at-test-run.mjs').TestRunAssertion} TestRunAssertion */
/** @typedef {import('./aria-at-test-run.mjs').TestRunAdditionalAssertion} TestRunAdditionalAssertion */
/** @typedef {import('./aria-at-test-run.mjs').TestRunCommand} TestRunCommand */
/** @typedef {import("./aria-at-test-run.mjs").TestRunUnexpectedBehavior} TestRunUnexpected */
/** @typedef {import("./aria-at-test-run.mjs").TestRunNegativeSideEffect} TestRunUnexpected */

/** @typedef {import('./aria-at-test-run.mjs').TestPageDocument} TestPageDocument */
Loading
Loading