Skip to content

Commit 1646094

Browse files
committed
Hide the batch details, protocol etc. on summary
For already vaccinated records we don't have and should not show these vaccination details. Now that we are treating already vaccinated records as having outcome `administered` we need to include logic specific to the new `manual_report` source in the `AppVaccinationRecordSummaryComponent`. Jira-Issue: MAV-2848 Jira-Issue: MAV-3404
1 parent 3dbacde commit 1646094

2 files changed

Lines changed: 25 additions & 1 deletion

File tree

app/components/app_vaccination_record_summary_component.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def call
4545
row.with_value { programme_value }
4646
end
4747

48-
if @vaccination_record.administered?
48+
if @vaccination_record.administered? && !@vaccination_record.sourced_from_manual_report?
4949
summary_list.with_row do |row|
5050
row.with_key { "Vaccine" }
5151

spec/components/app_vaccination_record_summary_component_spec.rb

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@
9797

9898
it { should_not have_css(".nhsuk-summary-list__row", text: "Vaccine") }
9999
end
100+
101+
context "when manually reported that vaccination was already had" do
102+
let(:source) { "manual_report" }
103+
104+
it { should_not have_css(".nhsuk-summary-list__row", text: "Vaccine") }
105+
end
100106
end
101107

102108
describe "method row" do
@@ -106,6 +112,12 @@
106112
text: "MethodIntramuscular"
107113
)
108114
end
115+
116+
context "when manually reported that vaccination was already had" do
117+
let(:source) { "manual_report" }
118+
119+
it { should_not have_css(".nhsuk-summary-list__row", text: "MethodIntramuscular") }
120+
end
109121
end
110122

111123
describe "site row" do
@@ -115,6 +127,12 @@
115127
text: "SiteLeft arm (upper position)"
116128
)
117129
end
130+
131+
context "when manually reported that vaccination was already had" do
132+
let(:source) { "manual_report" }
133+
134+
it { should_not have_css(".nhsuk-summary-list__row", text: "MethodIntramuscular") }
135+
end
118136
end
119137

120138
describe "dose volume row" do
@@ -193,6 +211,12 @@
193211
before { vaccination_record.dose_sequence = 2 }
194212

195213
it { should have_content("Dose number2nd") }
214+
215+
context "when manually reported that vaccination was already had" do
216+
let(:source) { "manual_report" }
217+
218+
it { should have_content("Dose number2nd") }
219+
end
196220
end
197221
end
198222
end

0 commit comments

Comments
 (0)