Skip to content

Commit 7596c55

Browse files
committed
update button text to match prototype
1 parent a74dea3 commit 7596c55

10 files changed

+63
-118
lines changed

manage_breast_screening/mammograms/presenters/medical_information_presenter.py

Lines changed: 12 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
from manage_breast_screening.mammograms.presenters.symptom_presenter import (
2525
SymptomPresenter,
2626
)
27-
from manage_breast_screening.participants.models.symptom import SymptomType
2827

2928
from .appointment_presenters import AppointmentPresenter
3029

@@ -104,14 +103,7 @@ def medical_history_buttons(self):
104103
def add_lump_button(self):
105104
url = reverse("mammograms:add_symptom_lump", kwargs={"pk": self.appointment.pk})
106105

107-
return {
108-
"href": url,
109-
"text": (
110-
"Add another lump"
111-
if SymptomType.LUMP in self.existing_symptom_type_ids
112-
else "Add a lump"
113-
),
114-
}
106+
return {"href": url, "text": "Lump"}
115107

116108
@property
117109
def add_swelling_or_shape_change_button(self):
@@ -120,15 +112,7 @@ def add_swelling_or_shape_change_button(self):
120112
kwargs={"pk": self.appointment.pk},
121113
)
122114

123-
return {
124-
"href": url,
125-
"text": (
126-
"Add another swelling or shape change"
127-
if SymptomType.SWELLING_OR_SHAPE_CHANGE
128-
in self.existing_symptom_type_ids
129-
else "Add a swelling or shape change"
130-
),
131-
}
115+
return {"href": url, "text": "Swelling or shape change"}
132116

133117
@property
134118
def add_skin_change_button(self):
@@ -137,14 +121,7 @@ def add_skin_change_button(self):
137121
kwargs={"pk": self.appointment.pk},
138122
)
139123

140-
return {
141-
"href": url,
142-
"text": (
143-
"Add another skin change"
144-
if SymptomType.SKIN_CHANGE in self.existing_symptom_type_ids
145-
else "Add a skin change"
146-
),
147-
}
124+
return {"href": url, "text": "Skin change"}
148125

149126
@property
150127
def add_nipple_change_button(self):
@@ -153,14 +130,7 @@ def add_nipple_change_button(self):
153130
kwargs={"pk": self.appointment.pk},
154131
)
155132

156-
return {
157-
"href": url,
158-
"text": (
159-
"Add another nipple change"
160-
if SymptomType.NIPPLE_CHANGE in self.existing_symptom_type_ids
161-
else "Add a nipple change"
162-
),
163-
}
133+
return {"href": url, "text": "Nipple change"}
164134

165135
@property
166136
def add_other_symptom_button(self):
@@ -169,14 +139,7 @@ def add_other_symptom_button(self):
169139
kwargs={"pk": self.appointment.pk},
170140
)
171141

172-
return {
173-
"href": url,
174-
"text": (
175-
"Add another symptom (other symptom)"
176-
if SymptomType.NIPPLE_CHANGE in self.existing_symptom_type_ids
177-
else "Add a symptom (other symptom)"
178-
),
179-
}
142+
return {"href": url, "text": "Other"}
180143

181144
@property
182145
def add_breast_cancer_history_button(self):
@@ -187,7 +150,7 @@ def add_breast_cancer_history_button(self):
187150

188151
return {
189152
"href": url,
190-
"text": ("Add breast cancer history"),
153+
"text": "Breast cancer",
191154
}
192155

193156
@property
@@ -199,7 +162,7 @@ def add_implanted_medical_device_history_button(self):
199162

200163
return {
201164
"href": url,
202-
"text": ("Add implanted medical device history"),
165+
"text": "Implanted medical device",
203166
}
204167

205168
@property
@@ -211,7 +174,7 @@ def add_cyst_history_button(self):
211174

212175
return {
213176
"href": url,
214-
"text": ("Add cyst history"),
177+
"text": ("Cysts"),
215178
}
216179

217180
@property
@@ -223,7 +186,7 @@ def add_breast_augmentation_history_button(self):
223186

224187
return {
225188
"href": url,
226-
"text": ("Add breast augmentation history"),
189+
"text": "Breast implants or augmentation",
227190
}
228191

229192
@property
@@ -235,7 +198,7 @@ def add_benign_lump_history_button(self):
235198

236199
return {
237200
"href": url,
238-
"text": "Add benign lump history",
201+
"text": "Benign lumps",
239202
}
240203

241204
@property
@@ -247,7 +210,7 @@ def add_mastectomy_or_lumpectomy_history_button(self):
247210

248211
return {
249212
"href": url,
250-
"text": "Add mastectomy or lumpectomy history",
213+
"text": "Mastectomy or lumpectomy",
251214
}
252215

253216
@property
@@ -259,7 +222,7 @@ def add_other_procedure_history_button(self):
259222

260223
return {
261224
"href": url,
262-
"text": "Add other procedure history",
225+
"text": "Other procedures",
263226
}
264227

265228
def _present_items(self, items, presenter_class):

manage_breast_screening/mammograms/tests/presenters/test_medical_information_presenter.py

Lines changed: 9 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -83,39 +83,15 @@ def test_add_lump_button(self):
8383

8484
assert MedicalInformationPresenter(appointment).add_lump_button == {
8585
"href": f"/mammograms/{appointment.pk}/record-medical-information/lump/",
86-
"text": "Add a lump",
87-
}
88-
89-
SymptomFactory.create(
90-
appointment=appointment,
91-
lump=True,
92-
when_started=RelativeDateChoices.LESS_THAN_THREE_MONTHS,
93-
area=SymptomAreas.BOTH_BREASTS,
94-
)
95-
96-
assert MedicalInformationPresenter(appointment).add_lump_button == {
97-
"href": f"/mammograms/{appointment.pk}/record-medical-information/lump/",
98-
"text": "Add another lump",
86+
"text": "Lump",
9987
}
10088

10189
def test_add_nipple_change_button(self):
10290
appointment = AppointmentFactory()
10391

10492
assert MedicalInformationPresenter(appointment).add_nipple_change_button == {
10593
"href": f"/mammograms/{appointment.pk}/record-medical-information/nipple-change/",
106-
"text": "Add a nipple change",
107-
}
108-
109-
SymptomFactory.create(
110-
appointment=appointment,
111-
inversion=True,
112-
when_started=RelativeDateChoices.LESS_THAN_THREE_MONTHS,
113-
area=SymptomAreas.BOTH_BREASTS,
114-
)
115-
116-
assert MedicalInformationPresenter(appointment).add_nipple_change_button == {
117-
"href": f"/mammograms/{appointment.pk}/record-medical-information/nipple-change/",
118-
"text": "Add another nipple change",
94+
"text": "Nipple change",
11995
}
12096

12197
def test_add_breast_cancer_history_button(self):
@@ -125,7 +101,7 @@ def test_add_breast_cancer_history_button(self):
125101
appointment
126102
).add_breast_cancer_history_button == {
127103
"href": f"/mammograms/{appointment.pk}/record-medical-information/breast-cancer-history/",
128-
"text": "Add breast cancer history",
104+
"text": "Breast cancer",
129105
}
130106

131107
def test_implanted_medical_device_history_button(self):
@@ -135,7 +111,7 @@ def test_implanted_medical_device_history_button(self):
135111
appointment
136112
).add_implanted_medical_device_history_button == {
137113
"href": f"/mammograms/{appointment.pk}/record-medical-information/implanted-medical-device-history/",
138-
"text": "Add implanted medical device history",
114+
"text": "Implanted medical device",
139115
}
140116

141117
def test_implanted_medical_device_history_items_have_a_counter(self):
@@ -193,7 +169,7 @@ def test_cyst_history_button(self):
193169

194170
assert MedicalInformationPresenter(appointment).add_cyst_history_button == {
195171
"href": f"/mammograms/{appointment.pk}/record-medical-information/cyst-history/",
196-
"text": "Add cyst history",
172+
"text": "Cysts",
197173
}
198174

199175
def test_breast_augmentation_history_button(self):
@@ -203,7 +179,7 @@ def test_breast_augmentation_history_button(self):
203179
appointment
204180
).add_breast_augmentation_history_button == {
205181
"href": f"/mammograms/{appointment.pk}/record-medical-information/breast-augmentation-history/",
206-
"text": "Add breast augmentation history",
182+
"text": "Breast implants or augmentation",
207183
}
208184

209185
def test_add_benign_lump_history_button(self):
@@ -213,7 +189,7 @@ def test_add_benign_lump_history_button(self):
213189
appointment
214190
).add_benign_lump_history_button == {
215191
"href": f"/mammograms/{appointment.pk}/record-medical-information/benign-lump-history/",
216-
"text": "Add benign lump history",
192+
"text": "Benign lumps",
217193
}
218194

219195
def test_mastectomy_or_lumpectomy_history_button(self):
@@ -223,7 +199,7 @@ def test_mastectomy_or_lumpectomy_history_button(self):
223199
appointment
224200
).add_mastectomy_or_lumpectomy_history_button == {
225201
"href": f"/mammograms/{appointment.pk}/record-medical-information/mastectomy-or-lumpectomy-history/",
226-
"text": "Add mastectomy or lumpectomy history",
202+
"text": "Mastectomy or lumpectomy",
227203
}
228204

229205
def test_mastectomy_or_lumpectomy_history_items_have_a_counter(self):
@@ -261,7 +237,7 @@ def test_other_procedure_history_button(self):
261237
appointment
262238
).add_other_procedure_history_button == {
263239
"href": f"/mammograms/{appointment.pk}/record-medical-information/other-procedure-history/",
264-
"text": "Add other procedure history",
240+
"text": "Other procedures",
265241
}
266242

267243
def test_other_procedure_history_items_have_a_counter(self):

manage_breast_screening/tests/system/clinical/test_benign_lump_history.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def test_adding_a_benign_lump_history_item(self):
1919
self.given_i_am_logged_in_as_a_clinical_user()
2020
self.and_there_is_an_appointment()
2121
self.and_i_am_on_the_record_medical_information_page()
22-
self.when_i_click_on_add_benign_lump_history()
22+
self.when_i_click_on_benign_lumps()
2323
self.then_i_see_the_add_benign_lump_history_form()
2424
self.when_i_try_to_save_without_entering_benign_lump_details()
2525
self.then_i_see_validation_errors_for_missing_benign_lump_details()
@@ -54,7 +54,7 @@ def test_accessibility(self):
5454
self.given_i_am_logged_in_as_a_clinical_user()
5555
self.and_there_is_an_appointment()
5656
self.and_i_am_on_the_record_medical_information_page()
57-
self.when_i_click_on_add_benign_lump_history()
57+
self.when_i_click_on_benign_lumps()
5858
self.then_the_accessibility_baseline_is_met()
5959

6060
def and_there_is_an_appointment(self):
@@ -74,8 +74,8 @@ def and_i_am_on_the_record_medical_information_page(self):
7474
)
7575
)
7676

77-
def when_i_click_on_add_benign_lump_history(self):
78-
self.page.get_by_text("Add benign lump history", exact=True).click()
77+
def when_i_click_on_benign_lumps(self):
78+
self.page.get_by_role("button").filter(has_text="Benign lumps").click()
7979

8080
def then_i_see_the_add_benign_lump_history_form(self):
8181
expect(self.page.get_by_text("Add details of benign lumps")).to_be_visible()

manage_breast_screening/tests/system/clinical/test_breast_augmentation_history.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def test_adding_breast_augmentation(self):
1515
self.given_i_am_logged_in_as_a_clinical_user()
1616
self.and_there_is_an_appointment()
1717
self.and_i_am_on_the_record_medical_information_page()
18-
self.when_i_click_on_add_breast_augmentation()
18+
self.when_i_click_on_breast_implants_or_augmentation()
1919
self.then_i_see_the_add_breast_augmentation_form()
2020

2121
self.when_i_click_save_without_entering_details()
@@ -42,7 +42,7 @@ def test_accessibility(self):
4242
self.given_i_am_logged_in_as_a_clinical_user()
4343
self.and_there_is_an_appointment()
4444
self.and_i_am_on_the_record_medical_information_page()
45-
self.when_i_click_on_add_breast_augmentation()
45+
self.when_i_click_on_breast_implants_or_augmentation()
4646
self.then_the_accessibility_baseline_is_met()
4747

4848
def and_there_is_an_appointment(self):
@@ -62,8 +62,10 @@ def and_i_am_on_the_record_medical_information_page(self):
6262
)
6363
)
6464

65-
def when_i_click_on_add_breast_augmentation(self):
66-
self.page.get_by_text("Add breast augmentation history").click()
65+
def when_i_click_on_breast_implants_or_augmentation(self):
66+
self.page.get_by_role("button").filter(
67+
has_text="Breast implants or augmentation"
68+
).click()
6769

6870
def then_i_see_the_add_breast_augmentation_form(self):
6971
expect(

manage_breast_screening/tests/system/clinical/test_breast_cancer_history.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def test_adding_and_editing_breast_cancer_history(self):
1515
self.given_i_am_logged_in_as_a_clinical_user()
1616
self.and_there_is_an_appointment()
1717
self.and_i_am_on_the_record_medical_information_page()
18-
self.when_i_click_on_add_breast_cancer_history()
18+
self.when_i_click_on_breast_cancer()
1919
self.then_i_see_the_add_breast_cancer_history_form()
2020

2121
self.when_i_select_right_breast()
@@ -50,14 +50,14 @@ def test_accessibility(self):
5050
self.given_i_am_logged_in_as_a_clinical_user()
5151
self.and_there_is_an_appointment()
5252
self.and_i_am_on_the_record_medical_information_page()
53-
self.when_i_click_on_add_breast_cancer_history()
53+
self.when_i_click_on_breast_cancer()
5454
self.then_the_accessibility_baseline_is_met()
5555

5656
def test_validation_errors(self):
5757
self.given_i_am_logged_in_as_a_clinical_user()
5858
self.and_there_is_an_appointment()
5959
self.and_i_am_on_the_record_medical_information_page()
60-
self.when_i_click_on_add_breast_cancer_history()
60+
self.when_i_click_on_breast_cancer()
6161
self.and_i_click_save()
6262
self.then_i_am_prompted_to_fill_in_required_fields()
6363

@@ -78,8 +78,8 @@ def and_i_am_on_the_record_medical_information_page(self):
7878
)
7979
)
8080

81-
def when_i_click_on_add_breast_cancer_history(self):
82-
self.page.get_by_text("Add breast cancer history").click()
81+
def when_i_click_on_breast_cancer(self):
82+
self.page.get_by_role("button").filter(has_text="Breast cancer").click()
8383

8484
def then_i_see_the_add_breast_cancer_history_form(self):
8585
expect(self.page.get_by_text("Add details of breast cancer")).to_be_visible()
@@ -215,4 +215,3 @@ def and_the_history_item_is_gone(self):
215215
row = self.page.locator(".nhsuk-summary-list__row").filter(has=key)
216216
expect(row).not_to_contain_text("Cancer location")
217217
expect(row.get_by_text("Change")).not_to_be_attached()
218-
expect(row.get_by_text("Add breast cancer history")).to_be_attached()

manage_breast_screening/tests/system/clinical/test_cyst_history.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def test_adding_and_changing_cyst(self):
1515
self.given_i_am_logged_in_as_a_clinical_user()
1616
self.and_there_is_an_appointment()
1717
self.and_i_am_on_the_record_medical_information_page()
18-
self.when_i_click_on_add_cyst()
18+
self.when_i_click_on_cysts()
1919
self.then_i_see_the_add_cyst_form()
2020

2121
self.when_i_select_no_treatment()
@@ -36,7 +36,7 @@ def test_accessibility(self):
3636
self.given_i_am_logged_in_as_a_clinical_user()
3737
self.and_there_is_an_appointment()
3838
self.and_i_am_on_the_record_medical_information_page()
39-
self.when_i_click_on_add_cyst()
39+
self.when_i_click_on_cysts()
4040
self.then_the_accessibility_baseline_is_met()
4141

4242
def and_there_is_an_appointment(self):
@@ -56,8 +56,8 @@ def and_i_am_on_the_record_medical_information_page(self):
5656
)
5757
)
5858

59-
def when_i_click_on_add_cyst(self):
60-
self.page.get_by_text("Add cyst history").click()
59+
def when_i_click_on_cysts(self):
60+
self.page.get_by_role("button").filter(has_text="Cysts").click()
6161

6262
def then_i_see_the_add_cyst_form(self):
6363
expect(self.page.get_by_text("Add details of cysts")).to_be_visible()

0 commit comments

Comments
 (0)