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

[CRIMAPP-1385] Update search default to all applications #722

Merged
merged 2 commits into from
Oct 10, 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
2 changes: 1 addition & 1 deletion app/lib/types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module Types # rubocop:disable Metrics/ModuleLength
'all' => REVIEW_APPLICATION_STATUSES
}.freeze

ReviewStatusGroup = String.default('open'.freeze).enum(
ReviewStatusGroup = String.default('all'.freeze).enum(
*REVIEW_STATUS_GROUPS.keys
)

Expand Down
4 changes: 2 additions & 2 deletions spec/models/application_search_filter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
context 'when the filter is empty' do
let(:expected_datastore_params) do
{
review_status: %w[application_received ready_for_assessment],
review_status: %w[application_received returned_to_provider ready_for_assessment assessment_completed],
}
end

it 'returns the correct datastore api search params for all open applications' do
it 'returns the correct datastore api search params for all applications' do
expect(datastore_params).to eq(expected_datastore_params)
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
expect_datastore_to_have_been_searched_with(
{
application_id_in: unassigned_application_ids,
review_status: Types::REVIEW_STATUS_GROUPS['open']
review_status: Types::REVIEW_STATUS_GROUPS['all']
}
)
end
Expand Down
6 changes: 3 additions & 3 deletions spec/system/casework/searching/filter_by_caseworker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

it 'excludes assigned applications from the search' do
expect_datastore_to_have_been_searched_with({
review_status: Types::REVIEW_STATUS_GROUPS['open'],
review_status: Types::REVIEW_STATUS_GROUPS['all'],
application_id_in: unassigned_application_ids
})
end
Expand All @@ -40,7 +40,7 @@

it 'excludes unassigned applications from the search' do
expect_datastore_to_have_been_searched_with({
review_status: Types::REVIEW_STATUS_GROUPS['open'],
review_status: Types::REVIEW_STATUS_GROUPS['all'],
application_id_in: current_assignment_ids
})
end
Expand All @@ -58,7 +58,7 @@

it 'excludes unassigned applications from the search' do
expect_datastore_to_have_been_searched_with({
review_status: Types::REVIEW_STATUS_GROUPS['open'],
review_status: Types::REVIEW_STATUS_GROUPS['all'],
application_id_in: davids_applications
})
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
it 'searches by applicant date of birth' do
expect_datastore_to_have_been_searched_with({
applicant_date_of_birth: '2011-06-09',
review_status: Types::REVIEW_STATUS_GROUPS['open']
review_status: Types::REVIEW_STATUS_GROUPS['all']
})
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
{
submitted_before: '2023-01-09 00:00:00 +0000',
submitted_after: '2023-06-08 00:00:00 +0100',
review_status: Types::REVIEW_STATUS_GROUPS['open']
review_status: Types::REVIEW_STATUS_GROUPS['all']
}
)
end
Expand Down
8 changes: 2 additions & 6 deletions spec/system/casework/searching/filter_by_status_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,15 @@
click_link 'Search'
end

it 'filters by "Open" by default' do
expect(page).to have_select(filter_field, selected: 'Open')
end

it "can choose from 'Open', 'Completed', 'Sent back to provider' or 'All applications'" do
choices = ['Open', 'Closed', 'Completed', 'Sent back to provider', 'All applications']
expect(page).to have_select(filter_field, options: choices)
end

describe 'search by:' do
describe 'default' do
it 'filters by status "open"' do
expect(page).to have_select(filter_field, selected: 'Open')
it 'filters by status "all"' do
expect(page).to have_select(filter_field, selected: 'All applications')
end
end

Expand Down
Loading