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

Added the missing our_support row #6613

Merged
merged 1 commit into from
Mar 15, 2024
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
5 changes: 5 additions & 0 deletions src/client/modules/ExportWins/Details/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ const Detail = (props) => {
{exportWin &&
(exportWin.customerResponse.agreeWithWin ? 'Yes' : 'No')}
</SummaryTable.Row>
{exportWin?.customerResponse?.agreeWithWin && (
<SummaryTable.Row heading="What value do you estimate you would have achieved without our support">
{exportWin?.customerResponse.ourSupport?.name}
</SummaryTable.Row>
)}
</Summary>
{exportWin &&
exportWin.customerResponse.agreeWithWin === WIN_STATUS.SENT && (
Expand Down
10 changes: 9 additions & 1 deletion test/component/cypress/specs/ExportWins/Details.cy.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const EXPORT_WIN = {
],
customer_response: {
agree_with_win: WIN_STATUS.SENT, // the default
our_support: null,
},
}

Expand Down Expand Up @@ -78,20 +79,24 @@ describe('ExportWins/Details', () => {
)

;[
// FIXME: There's no test case for rejected win
{
testTitle: 'Confirmed',
exportWinAPIResponse: {
...EXPORT_WIN,
customer_response: {
agree_with_win: true,
comments: 'I agree',
our_support: {
name: 'Not very much',
},
},
},
tableRows: insertAfter(
{
...EXPECTED_ROWS,
'Export win confirmed': 'Yes',
'What value do you estimate you would have achieved without our support':
'Not very much',
},
'Lead officer name',
{
Expand Down Expand Up @@ -412,6 +417,9 @@ describe('ExportWins/Details', () => {
...EXPORT_WIN,
customer_response: {
agree_with_win: WIN_STATUS.WON,
our_support: {
name: 'A fortune',
},
},
}}
/>
Expand Down
Loading