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 follow up #596

Open
wants to merge 18 commits into
base: main
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
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ export const CANDIDATE_REPORTS_QUERY = gql`
unexpectedBehaviors {
id
text
otherUnexpectedBehaviorText
}
unexpectedBehaviorNote
}
}
draftTestPlanRuns {
Expand Down
7 changes: 3 additions & 4 deletions client/components/Reports/SummarizeTestPlanReport.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -274,11 +274,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
14 changes: 14 additions & 0 deletions client/components/Reports/TestPlanResultsTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,20 @@ const TestPlanResultsTable = ({ test, testResult, tableClassName = '' }) => {
</li>
)
)}
{scenarioResult.unexpectedBehaviorNote ? (
<div>
Explanation:&nbsp;
<em>
&quot;
{
scenarioResult.unexpectedBehaviorNote
}
&quot;
</em>
</div>
) : (
''
)}
</ul>
) : (
'None'
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 @@ -119,8 +119,8 @@ export const REPORT_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 @@ -83,8 +83,8 @@ export const VERSION_QUERY = gql`
}
unexpectedBehaviors {
id
otherUnexpectedBehaviorText
}
unexpectedBehaviorNote
}
}
}
Expand Down
Loading