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
Changes from 1 commit
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
Prev Previous commit
Next Next commit
lint fixes
evmiguel committed Apr 5, 2023
commit 797af9a1396a2abf674a96ab88f8e72e5c75ee50
66 changes: 33 additions & 33 deletions tests/resources/aria-at-test-io-format.mjs
Original file line number Diff line number Diff line change
@@ -234,9 +234,8 @@ class CommandsInput {
commands: {
[collectedTest.info.task]: {
[collectedTest.target.mode]: {
[collectedTest.target.at
.key]: collectedTest.commands.map(({ id, extraInstruction }) =>
extraInstruction ? [id, extraInstruction] : [id]
[collectedTest.target.at.key]: collectedTest.commands.map(
({ id, extraInstruction }) => (extraInstruction ? [id, extraInstruction] : [id])
),
},
},
@@ -892,39 +891,40 @@ export class TestRunInputOutput {
enabled: true,
},
commands: test.commands.map(
command => /** @type {import("./aria-at-test-run.mjs").TestRunCommand} */ ({
description: command,
atOutput: {
highlightRequired: false,
value: '',
},
assertions: test.assertions.map(assertion => ({
description: assertion.assertion,
highlightRequired: false,
priority: assertion.priority,
result: CommonResultMap.NOT_SET,
})),
additionalAssertions: test.additionalAssertions.map(assertion => ({
description: assertion.assertion,
highlightRequired: false,
priority: assertion.priority,
result: CommonResultMap.NOT_SET,
})),
unexpected: {
highlightRequired: false,
hasUnexpected: HasUnexpectedBehaviorMap.NOT_SET,
tabbedBehavior: 0,
behaviors: test.unexpectedBehaviors.map(({ description, requireExplanation }) => ({
description,
checked: false,
requireExplanation,
})),
note: {
command =>
/** @type {import("./aria-at-test-run.mjs").TestRunCommand} */ ({
description: command,
atOutput: {
highlightRequired: false,
value: '',
},
},
})
assertions: test.assertions.map(assertion => ({
description: assertion.assertion,
highlightRequired: false,
priority: assertion.priority,
result: CommonResultMap.NOT_SET,
})),
additionalAssertions: test.additionalAssertions.map(assertion => ({
description: assertion.assertion,
highlightRequired: false,
priority: assertion.priority,
result: CommonResultMap.NOT_SET,
})),
unexpected: {
highlightRequired: false,
hasUnexpected: HasUnexpectedBehaviorMap.NOT_SET,
tabbedBehavior: 0,
behaviors: test.unexpectedBehaviors.map(({ description, requireExplanation }) => ({
description,
checked: false,
requireExplanation,
})),
note: {
highlightRequired: false,
value: '',
},
},
})
),
};

54 changes: 27 additions & 27 deletions tests/resources/types/aria-at-test-result.js
Original file line number Diff line number Diff line change
@@ -5,34 +5,34 @@

/**
* @typedef {"REQUIRED"
* | "OPTIONAL"} AriaATTestResult.AssertionPriorityJSON
*/
* | "OPTIONAL"} AriaATTestResult.AssertionPriorityJSON
*/

/**
* @typedef {"INCORRECT_OUTPUT"
* | "NO_OUTPUT"} AriaATTestResult.AssertionFailedReasonJSON
*/
* @typedef {"INCORRECT_OUTPUT"
* | "NO_OUTPUT"} AriaATTestResult.AssertionFailedReasonJSON
*/

/**
* @typedef AriaATTestResult.JSON
* @property {object} test
* @property {string} test.title
* @property {object} test.at
* @property {string} test.at.id
* @property {string} test.atMode
* @property {object[]} scenarioResults
* @property {object} scenarioResults[].scenario
* @property {object} scenarioResults[].scenario.command
* @property {string} scenarioResults[].scenario.command.id
* @property {string} scenarioResults[].output
* @property {object[]} scenarioResults[].assertionResults
* @property {object} scenarioResults[].assertionResults[].assertion
* @property {AriaATTestResult.AssertionPriorityJSON} scenarioResults[].assertionResults[].assertion.priority
* @property {string} scenarioResults[].assertionResults[].assertion.text
* @property {boolean} scenarioResults[].assertionResults[].passed
* @property {AriaATTestResult.AssertionFailedReasonJSON | null} [scenarioResults[].assertionResults[].failedReason]
* @property {object[]} scenarioResults[].unexpectedBehaviors
* @property {string} scenarioResults[].unexpectedBehaviors[].id
* @property {string} scenarioResults[].unexpectedBehaviors[].text
* @property {string | null} [scenarioResults[].unexpectedBehaviorNote]
*/
* @typedef AriaATTestResult.JSON
* @property {object} test
* @property {string} test.title
* @property {object} test.at
* @property {string} test.at.id
* @property {string} test.atMode
* @property {object[]} scenarioResults
* @property {object} scenarioResults[].scenario
* @property {object} scenarioResults[].scenario.command
* @property {string} scenarioResults[].scenario.command.id
* @property {string} scenarioResults[].output
* @property {object[]} scenarioResults[].assertionResults
* @property {object} scenarioResults[].assertionResults[].assertion
* @property {AriaATTestResult.AssertionPriorityJSON} scenarioResults[].assertionResults[].assertion.priority
* @property {string} scenarioResults[].assertionResults[].assertion.text
* @property {boolean} scenarioResults[].assertionResults[].passed
* @property {AriaATTestResult.AssertionFailedReasonJSON | null} [scenarioResults[].assertionResults[].failedReason]
* @property {object[]} scenarioResults[].unexpectedBehaviors
* @property {string} scenarioResults[].unexpectedBehaviors[].id
* @property {string} scenarioResults[].unexpectedBehaviors[].text
* @property {string | null} [scenarioResults[].unexpectedBehaviorNote]
*/
160 changes: 80 additions & 80 deletions tests/resources/types/aria-at-test-run.js
Original file line number Diff line number Diff line change
@@ -2,99 +2,99 @@

/**
* @typedef {"reading"
* | "interaction"} AriaATTestRun.ATMode
*/
* | "interaction"} AriaATTestRun.ATMode
*/

/**
* @typedef {"loadPage"
* | "openTestWindow"
* | "closeTestWindow"
* | "validateResults"
* | "changeText"
* | "changeSelection"
* | "showResults"} AriaATTestRun.UserActionName
*/
* @typedef {"loadPage"
* | "openTestWindow"
* | "closeTestWindow"
* | "validateResults"
* | "changeText"
* | "changeSelection"
* | "showResults"} AriaATTestRun.UserActionName
*/

/**
* @typedef {"focusUnexpected"} AriaATTestRun.UserActionObjectName
*/
* @typedef {"focusUnexpected"} AriaATTestRun.UserActionObjectName
*/

/**
* @typedef AriaATTestRun.UserActionFocusUnexpected
* @property {"focusUnexpected"} action
* @property {number} commandIndex
* @property {number} unexpectedIndex
*/
* @typedef AriaATTestRun.UserActionFocusUnexpected
* @property {"focusUnexpected"} action
* @property {number} commandIndex
* @property {number} unexpectedIndex
*/

/**
* @typedef {AriaATTestRun.UserActionName
* | AriaATTestRun.UserActionFocusUnexpected} AriaATTestRun.UserAction
*/
* @typedef {AriaATTestRun.UserActionName
* | AriaATTestRun.UserActionFocusUnexpected} AriaATTestRun.UserAction
*/

/**
* @typedef {"notSet"
* | "pass"
* | "failMissing"
* | "failIncorrect"} AriaATTestRun.AssertionResult
*/
* @typedef {"notSet"
* | "pass"
* | "failMissing"
* | "failIncorrect"} AriaATTestRun.AssertionResult
*/

/**
* @typedef {"notSet"
* | "pass"
* | "failSupport"} AriaATTestRun.AdditionalAssertionResult
*/
* @typedef {"notSet"
* | "pass"
* | "failSupport"} AriaATTestRun.AdditionalAssertionResult
*/

/**
* @typedef {"notSet"
* | "hasUnexpected"
* | "doesNotHaveUnexpected"} AriaATTestRun.HasUnexpectedBehavior
*/
* @typedef {"notSet"
* | "hasUnexpected"
* | "doesNotHaveUnexpected"} AriaATTestRun.HasUnexpectedBehavior
*/

/**
* @typedef AriaATTestRun.State
* This state contains all the serializable values that are needed to render any of the documents (InstructionDocument,
* ResultsTableDocument, and TestPageDocument) from the test-run module.
*
* @property {string[] | null} errors
* @property {object} info
* @property {string} info.description
* @property {string} info.task
* @property {AriaATTestRun.ATMode} info.mode
* @property {string} info.modeInstructions
* @property {string[]} info.userInstructions
* @property {string} info.setupScriptDescription
* @property {object} config
* @property {object} config.at
* @property {string} config.at.key
* @property {string} config.at.name
* @property {boolean} config.renderResultsAfterSubmit
* @property {boolean} config.displaySubmitButton
* @property {AriaATTestRun.UserAction} currentUserAction
* @property {object[]} commands
* @property {string} commands[].description
* @property {object} commands[].atOutput
* @property {boolean} commands[].atOutput.highlightRequired
* @property {string} commands[].atOutput.value
* @property {object[]} commands[].assertions
* @property {string} commands[].assertions[].description
* @property {boolean} commands[].assertions[].highlightRequired
* @property {number} commands[].assertions[].priority
* @property {AriaATTestRun.AssertionResult} commands[].assertions[].result
* @property {object[]} commands[].additionalAssertions
* @property {string} commands[].additionalAssertions[].description
* @property {boolean} commands[].additionalAssertions[].highlightRequired
* @property {number} commands[].additionalAssertions[].priority
* @property {AriaATTestRun.AdditionalAssertionResult} commands[].additionalAssertions[].result
* @property {object} commands[].unexpected
* @property {boolean} commands[].unexpected.highlightRequired
* @property {AriaATTestRun.HasUnexpectedBehavior} commands[].unexpected.hasUnexpected
* @property {number} commands[].unexpected.tabbedBehavior
* @property {object[]} commands[].unexpected.behaviors
* @property {string} commands[].unexpected.behaviors[].description
* @property {boolean} commands[].unexpected.behaviors[].checked
* @property {object} [commands[].unexpected.behaviors[].more]
* @property {boolean} commands[].unexpected.behaviors[].more.highlightRequired
* @property {string} commands[].unexpected.behaviors[].more.value
* @property {object} openTest
* @property {boolean} openTest.enabled
*/
* @typedef AriaATTestRun.State
* This state contains all the serializable values that are needed to render any of the documents (InstructionDocument,
* ResultsTableDocument, and TestPageDocument) from the test-run module.
*
* @property {string[] | null} errors
* @property {object} info
* @property {string} info.description
* @property {string} info.task
* @property {AriaATTestRun.ATMode} info.mode
* @property {string} info.modeInstructions
* @property {string[]} info.userInstructions
* @property {string} info.setupScriptDescription
* @property {object} config
* @property {object} config.at
* @property {string} config.at.key
* @property {string} config.at.name
* @property {boolean} config.renderResultsAfterSubmit
* @property {boolean} config.displaySubmitButton
* @property {AriaATTestRun.UserAction} currentUserAction
* @property {object[]} commands
* @property {string} commands[].description
* @property {object} commands[].atOutput
* @property {boolean} commands[].atOutput.highlightRequired
* @property {string} commands[].atOutput.value
* @property {object[]} commands[].assertions
* @property {string} commands[].assertions[].description
* @property {boolean} commands[].assertions[].highlightRequired
* @property {number} commands[].assertions[].priority
* @property {AriaATTestRun.AssertionResult} commands[].assertions[].result
* @property {object[]} commands[].additionalAssertions
* @property {string} commands[].additionalAssertions[].description
* @property {boolean} commands[].additionalAssertions[].highlightRequired
* @property {number} commands[].additionalAssertions[].priority
* @property {AriaATTestRun.AdditionalAssertionResult} commands[].additionalAssertions[].result
* @property {object} commands[].unexpected
* @property {boolean} commands[].unexpected.highlightRequired
* @property {AriaATTestRun.HasUnexpectedBehavior} commands[].unexpected.hasUnexpected
* @property {number} commands[].unexpected.tabbedBehavior
* @property {object[]} commands[].unexpected.behaviors
* @property {string} commands[].unexpected.behaviors[].description
* @property {boolean} commands[].unexpected.behaviors[].checked
* @property {object} [commands[].unexpected.behaviors[].more]
* @property {boolean} commands[].unexpected.behaviors[].more.highlightRequired
* @property {string} commands[].unexpected.behaviors[].more.value
* @property {object} openTest
* @property {boolean} openTest.enabled
*/