Skip to content

Commit

Permalink
Add hidden text when case type is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
timpeat committed Jan 14, 2025
1 parent 4ff65be commit 8e67f2d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<%= result.application_type.humanize %>
</td>
<td class="govuk-table__cell">
<%= result.case_type&.humanize %>
<%= result.case_type&.humanize || no_data(:case_type) %>
</td>
<td class="govuk-table__cell">
<%= l(result.submitted_at) %>
Expand Down
26 changes: 26 additions & 0 deletions spec/system/casework/searching/search_filters_and_results_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,32 @@
)
end

context 'when result is PSE' do
let(:stubbed_search_results) do
[
ApplicationSearchResult.new(
applicant_name: 'Kit Pound',
resource_id: '21c37e3e-520f-46f1-bd1f-5c25ffc57d70',
reference: 120_398_120,
status: 'submitted',
work_stream: 'criminal_applications_team',
submitted_at: '2022-10-24T09:50:04.019Z',
parent_id: '696dd4fd-b619-4637-ab42-a5f4565bcf4a',
application_type: 'post_submission_evidence'
)
]
end

it 'shows the correct results' do
first_row_text = page.first('.app-table tbody tr').text

expect(first_row_text).to eq(
'Kit Pound 120398120 Post submission evidence No data exists for Case type ' \
'24 Oct 2022 No data exists for Date closed No data exists for Caseworker Open'
)
end
end

it 'has the correct search results count' do
expect(page).to have_content('3 search results')
end
Expand Down

0 comments on commit 8e67f2d

Please sign in to comment.