Skip to content

Commit b44070b

Browse files
add 21-4138 to dashboard and add tests (#27583)
* add 21-4138 to dashboard and add tests * fix test
1 parent 8feff4f commit b44070b

File tree

4 files changed

+55
-3
lines changed

4 files changed

+55
-3
lines changed

app/controllers/v0/my_va/submission_statuses_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def restricted_list_of_forms
3030

3131
def restricted_benefits_intake_forms
3232
%w[20-10206 20-10207 21-0845 21-0972 21-10210 21-4142 21-4140 21-4142a 21-4502 21-8940V1 21P-0847 21P-527EZ
33-
21P-530EZ 21P-0969 21P-535 21-2680 21-0779 21-4192 21P-530a] + uploadable_forms
33+
21P-530EZ 21P-0969 21P-535 21-2680 21-0779 21-4192 21P-530a 21-4138] + uploadable_forms
3434
end
3535

3636
def decision_reviews_forms_if_enabled

spec/controllers/v0/my_va/submission_statuses_controller_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@
203203
it 'includes multi-party form IDs in the restricted benefits intake forms' do
204204
forms = controller.send(:restricted_benefits_intake_forms)
205205

206-
expect(forms).to include('21-2680', '21-0779', '21-4192', '21P-530a')
206+
expect(forms).to include('21-2680', '21-0779', '21-4192', '21P-530a', '21-4138')
207207
end
208208
end
209209

spec/factories/form_submissions.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,16 @@
7171
end
7272
end
7373

74+
trait :with_form214138 do
75+
user_account_id { '' }
76+
form_type { '21-4138' }
77+
updated_at { 1.day.ago }
78+
created_at { 2.days.ago }
79+
form_submission_attempts do
80+
create_list(:form_submission_attempt, 1, benefits_intake_uuid: 'c7e1f2a3-b4d5-4e6f-9a0b-1c2d3e4f5a6b')
81+
end
82+
end
83+
7484
trait :with_form_blocked do
7585
user_account_id { '' }
7686
form_type { 'NOT-WHITELISTED' }

spec/lib/forms/submission_statuses/report_spec.rb

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
subject { described_class.new(user_account:, allowed_forms:) }
1010

1111
let(:user_account) { create(:user_account) }
12-
let(:allowed_forms) { %w[20-10207 21-0845 21-0972 21-10210 21-4142 21-4142a 21P-0847 21-4140 21P-530EZ] }
12+
let(:allowed_forms) { %w[20-10207 21-0845 21-0972 21-10210 21-4138 21-4142 21-4142a 21P-0847 21-4140 21P-530EZ] }
1313
let(:benefits_intake_service) { instance_double(BenefitsIntake::Service) }
1414
let(:benefits_intake_gateway) { Forms::SubmissionStatuses::Gateways::BenefitsIntakeGateway }
1515

@@ -293,6 +293,48 @@
293293
end
294294
end
295295

296+
context 'when user has a 21-4138 submission' do
297+
before do
298+
create(:form_submission, :with_form214138, user_account_id: user_account.id)
299+
300+
allow_any_instance_of(benefits_intake_gateway).to receive(:lighthouse_submissions).and_return([])
301+
allow(BenefitsIntake::Service).to receive(:new).and_return(benefits_intake_service)
302+
allow(benefits_intake_service).to receive(:bulk_status).and_return(
303+
double(body: {
304+
'data' => [
305+
{
306+
'id' => 'c7e1f2a3-b4d5-4e6f-9a0b-1c2d3e4f5a6b',
307+
'attributes' => {
308+
'detail' => 'detail',
309+
'guid' => 'c7e1f2a3-b4d5-4e6f-9a0b-1c2d3e4f5a6b',
310+
'message' => 'message',
311+
'status' => 'received',
312+
'updated_at' => 1.day.ago
313+
}
314+
}
315+
]
316+
})
317+
)
318+
end
319+
320+
it 'includes the 21-4138 submission in the results' do
321+
result = subject.run
322+
323+
form_types = result.submission_statuses.map(&:form_type)
324+
expect(form_types).to include('21-4138')
325+
end
326+
327+
it 'returns the correct values for a 21-4138 submission' do
328+
result = subject.run
329+
330+
submission_status = result.submission_statuses.find { |s| s.form_type == '21-4138' }
331+
expect(submission_status).not_to be_nil
332+
expect(submission_status.id).to eq('c7e1f2a3-b4d5-4e6f-9a0b-1c2d3e4f5a6b')
333+
expect(submission_status.status).to eq('received')
334+
expect(submission_status.pdf_support).to be(true)
335+
end
336+
end
337+
296338
context 'logging errors' do
297339
let(:logger) { Rails.logger }
298340

0 commit comments

Comments
 (0)