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 #450

Closed
wants to merge 13 commits into from
47 changes: 32 additions & 15 deletions client/components/Reports/SummarizeTestPlanReport.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -349,20 +349,37 @@ const SummarizeTestPlanReport = ({ testPlanReport }) => {
{scenarioResult
.unexpectedBehaviors
.length ? (
<ul>
{scenarioResult.unexpectedBehaviors.map(
unexpected => (
<li
key={
unexpected.id
<>
<ul>
{scenarioResult.unexpectedBehaviors.map(
unexpected => (
<li
key={
unexpected.id
}
>
{
unexpected.text
}
</li>
)
)}
</ul>
{scenarioResult.unexpectedBehaviorNote ? (
<div>
Explanation:&nbsp;
<em>
&quot;
{
scenarioResult.unexpectedBehaviorNote
}
>
{unexpected.otherUnexpectedBehaviorText ??
unexpected.text}
</li>
)
&quot;
</em>
</div>
) : (
''
)}
</ul>
</>
) : (
'None'
)}
Expand Down Expand Up @@ -477,10 +494,10 @@ SummarizeTestPlanReport.propTypes = {
unexpectedBehaviors: PropTypes.arrayOf(
PropTypes.shape({
id: PropTypes.string.isRequired,
text: PropTypes.string.isRequired,
otherUnexpectedBehaviorText: PropTypes.string
text: PropTypes.string.isRequired
}).isRequired
).isRequired
).isRequired,
unexpectedBehaviorNote: PropTypes.string
}).isRequired
).isRequired
}).isRequired
Expand Down
2 changes: 1 addition & 1 deletion client/components/Reports/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ export const REPORTS_PAGE_QUERY = gql`
unexpectedBehaviors {
id
text
otherUnexpectedBehaviorText
}
unexpectedBehaviorNote
}
}
draftTestPlanRuns {
Expand Down
24 changes: 14 additions & 10 deletions client/components/ReviewConflicts/ReviewConflicts.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,23 @@ const ReviewConflicts = ({
const { testPlanRun, scenarioResult } = result;
let resultFormatted;
if (scenarioResult.unexpectedBehaviors.length) {
resultFormatted = scenarioResult.unexpectedBehaviors
.map(({ otherUnexpectedBehaviorText, text }) => {
return `"${otherUnexpectedBehaviorText ?? text}"`;
})
.join(' and ');
resultFormatted =
'the unexpected behavior ' +
scenarioResult.unexpectedBehaviors
.map(({ text }) => `"${text.toLowerCase()}"`)
.join(' and ');
} else {
resultFormatted = 'no unexpected behavior';
}
let noteFormatted = scenarioResult.unexpectedBehaviorNote
? ` with the explanation ` +
`"${scenarioResult.unexpectedBehaviorNote}"`
: '';
return (
<li key={testPlanRun.id}>
Tester {testPlanRun.tester.username} recorded output &quot;
{scenarioResult.output}&quot; and noted {resultFormatted}.
{scenarioResult.output}&quot; and noted&nbsp;
{resultFormatted + noteFormatted}.
</li>
);
});
Expand Down Expand Up @@ -160,11 +165,10 @@ ReviewConflicts.propTypes = {
output: PropTypes.string.isRequired,
unexpectedBehaviors: PropTypes.arrayOf(
PropTypes.shape({
text: PropTypes.string.isRequired,
otherUnexpectedBehaviorText:
PropTypes.string
text: PropTypes.string.isRequired
})
).isRequired
).isRequired,
unexpectedBehaviorNote: PropTypes.string
}),
assertionResult: PropTypes.shape({
passed: PropTypes.bool.isRequired,
Expand Down
2 changes: 1 addition & 1 deletion client/components/TestPlanUpdater/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ export const VERSION_QUERY = gql`
}
unexpectedBehaviors {
id
otherUnexpectedBehaviorText
}
unexpectedBehaviorNote
}
}
}
Expand Down
Loading