diff --git a/client/components/CandidateReview/CandidateTestPlanRun/queries.js b/client/components/CandidateReview/CandidateTestPlanRun/queries.js
index 638dcd0ca..1c81cdb8a 100644
--- a/client/components/CandidateReview/CandidateTestPlanRun/queries.js
+++ b/client/components/CandidateReview/CandidateTestPlanRun/queries.js
@@ -114,7 +114,6 @@ export const CANDIDATE_REPORTS_QUERY = gql`
text
}
passed
- failedReason
}
requiredAssertionResults: assertionResults(
priority: REQUIRED
@@ -123,7 +122,6 @@ export const CANDIDATE_REPORTS_QUERY = gql`
text
}
passed
- failedReason
}
optionalAssertionResults: assertionResults(
priority: OPTIONAL
@@ -132,14 +130,12 @@ export const CANDIDATE_REPORTS_QUERY = gql`
text
}
passed
- failedReason
}
mayAssertionResults: assertionResults(priority: MAY) {
assertion {
text
}
passed
- failedReason
}
unexpectedBehaviors {
id
diff --git a/client/components/Reports/SummarizeTestPlanReport.jsx b/client/components/Reports/SummarizeTestPlanReport.jsx
index 8bc86ff1c..2595b4c96 100644
--- a/client/components/Reports/SummarizeTestPlanReport.jsx
+++ b/client/components/Reports/SummarizeTestPlanReport.jsx
@@ -298,7 +298,6 @@ SummarizeTestPlanReport.propTypes = {
PropTypes.shape({
id: PropTypes.string.isRequired,
passed: PropTypes.bool.isRequired,
- failedReason: PropTypes.string,
assertion: PropTypes.shape({
text: PropTypes.string.isRequired
}).isRequired
diff --git a/client/components/Reports/queries.js b/client/components/Reports/queries.js
index 8234adfcd..0e7d15bd4 100644
--- a/client/components/Reports/queries.js
+++ b/client/components/Reports/queries.js
@@ -80,7 +80,6 @@ export const REPORT_PAGE_QUERY = gql`
text
}
passed
- failedReason
}
requiredAssertionResults: assertionResults(
priority: REQUIRED
@@ -89,7 +88,6 @@ export const REPORT_PAGE_QUERY = gql`
text
}
passed
- failedReason
}
optionalAssertionResults: assertionResults(
priority: OPTIONAL
@@ -98,14 +96,12 @@ export const REPORT_PAGE_QUERY = gql`
text
}
passed
- failedReason
}
mayAssertionResults: assertionResults(priority: MAY) {
assertion {
text
}
passed
- failedReason
}
unexpectedBehaviors {
id
diff --git a/client/components/ReviewConflicts/ReviewConflicts.jsx b/client/components/ReviewConflicts/ReviewConflicts.jsx
index e62bd928f..3dfe9ca4f 100644
--- a/client/components/ReviewConflicts/ReviewConflicts.jsx
+++ b/client/components/ReviewConflicts/ReviewConflicts.jsx
@@ -53,15 +53,9 @@ const ReviewConflicts = ({
const results = conflictingResults.map(result => {
const { testPlanRun, scenarioResult, assertionResult } = result;
let assertionResultFormatted;
- if (assertionResult.passed) {
- assertionResultFormatted = 'passing';
- } else {
- const reasonFormatted =
- assertionResult.failedReason === 'INCORRECT_OUTPUT'
- ? 'incorrect output'
- : 'no output';
- assertionResultFormatted = `failing with ${reasonFormatted}`;
- }
+ assertionResultFormatted = assertionResult.passed
+ ? 'passing'
+ : 'failing';
return (
Tester {testPlanRun.tester.username} recorded output "
@@ -167,8 +161,7 @@ ReviewConflicts.propTypes = {
).isRequired
}),
assertionResult: PropTypes.shape({
- passed: PropTypes.bool.isRequired,
- failedReason: PropTypes.string
+ passed: PropTypes.bool.isRequired
})
})
).isRequired
diff --git a/client/components/TestPlanUpdater/TestPlanUpdaterModal.jsx b/client/components/TestPlanUpdater/TestPlanUpdaterModal.jsx
index 3c6193dd2..2ed715182 100644
--- a/client/components/TestPlanUpdater/TestPlanUpdaterModal.jsx
+++ b/client/components/TestPlanUpdater/TestPlanUpdaterModal.jsx
@@ -181,9 +181,7 @@ const TestPlanUpdaterModal = ({
];
return {
id: assertionResultSkeleton.id,
- passed: assertionResult.passed,
- failedReason:
- assertionResult.failedReason
+ passed: assertionResult.passed
};
}
),
diff --git a/client/components/TestPlanUpdater/queries.js b/client/components/TestPlanUpdater/queries.js
index a6d92d169..4ece2f33d 100644
--- a/client/components/TestPlanUpdater/queries.js
+++ b/client/components/TestPlanUpdater/queries.js
@@ -79,7 +79,6 @@ export const VERSION_QUERY = gql`
output
assertionResults {
passed
- failedReason
}
unexpectedBehaviors {
id
diff --git a/client/components/TestRenderer/AssertionsFieldset/index.jsx b/client/components/TestRenderer/AssertionsFieldset/index.jsx
new file mode 100644
index 000000000..09d484b5d
--- /dev/null
+++ b/client/components/TestRenderer/AssertionsFieldset/index.jsx
@@ -0,0 +1,55 @@
+import React, { useMemo } from 'react';
+import PropTypes from 'prop-types';
+import { Fieldset } from '..';
+import styled from '@emotion/styled';
+import supportJson from '../../../resources/support.json';
+
+const Label = styled.label`
+ display: block;
+
+ input {
+ margin-right: 0.25rem;
+ }
+`;
+
+const AssertionsFieldset = ({ assertions, commandIndex, assertionsHeader }) => {
+ // Handle case where build process didn't include assertionResponseQuestion
+ const normalizedHeader = useMemo(() => {
+ return assertionsHeader?.descriptionHeader?.replace(
+ 'undefined',
+ supportJson.testPlanStrings.assertionResponseQuestion
+ );
+ }, [assertionsHeader]);
+
+ return (
+
+ );
+};
+
+AssertionsFieldset.propTypes = {
+ assertions: PropTypes.array.isRequired,
+ commandIndex: PropTypes.number.isRequired,
+ assertionsHeader: PropTypes.object.isRequired
+};
+
+export default AssertionsFieldset;
diff --git a/client/components/TestRenderer/index.jsx b/client/components/TestRenderer/index.jsx
index 6abed623d..6e966c86d 100644
--- a/client/components/TestRenderer/index.jsx
+++ b/client/components/TestRenderer/index.jsx
@@ -24,6 +24,7 @@ import { evaluateAtNameKey } from '../../utils/aria';
import OutputTextArea from './OutputTextArea';
import supportJson from '../../resources/support.json';
import commandsJson from '../../resources/commands.json';
+import AssertionsFieldset from './AssertionsFieldset';
const Container = styled.div`
width: 100%;
@@ -76,49 +77,7 @@ export const Feedback = styled.span`
}
`;
-const Table = styled.table`
- width: 100%;
-
- display: table;
- margin-bottom: 1em;
- border-spacing: 2px;
-
- border: black solid 1px;
-
- text-indent: initial;
- box-sizing: border-box;
- border-collapse: collapse;
-
- > tbody > tr {
- td,
- th {
- border: 1px solid black;
- padding: 0.25em;
- }
-
- td {
- > label {
- display: initial;
- vertical-align: middle;
- }
-
- > input[type='radio'] {
- margin: 0 5px 0 0;
- vertical-align: middle;
-
- &:nth-of-type(n + 2) {
- margin: 0 5px;
- }
- }
- }
-
- th {
- font-weight: bold;
- }
- }
-`;
-
-const Fieldset = styled.fieldset`
+export const Fieldset = styled.fieldset`
display: block;
margin-inline-start: 2px;
margin-inline-end: 2px;
@@ -303,13 +262,9 @@ const TestRenderer = ({
const assertionResult = assertionResults[j];
const { highlightRequired } = assertionResult;
- if (assertionResult.passed)
- commands[i].assertions[j].result = 'pass';
- else if (assertionResult.failedReason === 'NO_OUTPUT')
- commands[i].assertions[j].result = 'failMissing';
- else if (assertionResult.failedReason === 'INCORRECT_OUTPUT')
- commands[i].assertions[j].result = 'failIncorrect';
- else commands[i].assertions[j].result = 'notSet';
+ commands[i].assertions[j].result = assertionResult.passed
+ ? 'pass'
+ : 'fail';
commands[i].assertions[j].highlightRequired = highlightRequired;
}
@@ -425,11 +380,6 @@ const TestRenderer = ({
const atOutputError = item.atOutput.highlightRequired;
if (atOutputError) return true;
- const assertionsError = item.assertions.some(
- item => item.highlightRequired
- );
- if (assertionsError) return true;
-
const unexpectedError = item.unexpected.highlightRequired;
if (unexpectedError) return true;
@@ -454,11 +404,6 @@ const TestRenderer = ({
item.atOutput.description[1].highlightRequired;
if (atOutputError) return true;
- const assertionsError = item.assertions.some(
- item => item.description[1].highlightRequired
- );
- if (assertionsError) return true;
-
const unexpectedBehaviorError =
item.unexpectedBehaviors.description[1].highlightRequired;
if (unexpectedBehaviorError) return true;
@@ -613,11 +558,10 @@ const TestRenderer = ({
const {
header,
atOutput,
- assertionsHeader,
assertions,
- unexpectedBehaviors
+ unexpectedBehaviors,
+ assertionsHeader
} = value;
-
return (
-
- Assertions {header}
-
-
+
{/*Unexpected Behaviors*/}