feat(dashboard): replace home with approved minimal design
CI / ruff · pytest (pull_request) Successful in 2m1s
CI / ruff · pytest (pull_request) Successful in 2m1s
Refs #73
This commit is contained in:
@@ -173,11 +173,26 @@ def test_snils_checksum():
|
||||
|
||||
def test_ui_row_escapes_and_shows_values():
|
||||
p = fixtures.PATIENTS[0].model_copy(update={"last_event": "<script>x</script>"})
|
||||
html = ui.patient_row(p)
|
||||
html = ui.patient_row(p, detailed=True)
|
||||
assert "<script>" not in html and "<script>" in html
|
||||
assert "Андрей С." in html and "день терапии 13" in html and "↑" in html
|
||||
|
||||
|
||||
def test_home_fragments_escape_api_values():
|
||||
payload = '<img src=x onerror="alert(1)">'
|
||||
p = fixtures.PATIENTS[0].model_copy(
|
||||
update={
|
||||
"display_name": payload,
|
||||
"drug": payload,
|
||||
"last_event": payload,
|
||||
"discontinuation_risk": _risk(70, "high", [payload]),
|
||||
}
|
||||
)
|
||||
for html in (ui.patient_row(p), ui.patient_row(p, detailed=True), ui.workspace_header(payload, payload)):
|
||||
assert "<img" not in html
|
||||
assert "<img" in html
|
||||
|
||||
|
||||
def test_scale_figure_marks_unscheduled_and_bands():
|
||||
card = fixtures.andrey_card()
|
||||
fig = charts.scale_figure(card.series, "phq9", "PHQ-9", card.prescriptions[0].start_date)
|
||||
|
||||
Reference in New Issue
Block a user