diff --git a/openapi.yaml b/openapi.yaml index a29be73..594781a 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -544,7 +544,7 @@ components: minLength: 1 note: type: string - maxLength: 500 + description: Optional. Stored after trim, and the trimmed value must be 500 characters or fewer. AdminOverrideBody: type: object diff --git a/tests/shared/test_portal_ops.py b/tests/shared/test_portal_ops.py index 3eda8f2..441e65f 100644 --- a/tests/shared/test_portal_ops.py +++ b/tests/shared/test_portal_ops.py @@ -105,6 +105,14 @@ def test_swap_stores_returns_and_dms_note(schedule, seed, quiet_slack, monkeypat assert calls[0][1]["note"] == "Family commitment" +def test_swap_accepts_note_that_trims_to_500(schedule, seed, quiet_slack): + employee = _alice(schedule, seed) + seed.override("2026-06-12", "114", "Alice") + with freezegun.freeze_time("2026-06-08 12:00:00-04:00"): + swap(schedule, employee, "2026-06-12", "115", "night", note=f" {'a' * 500} ") + assert schedule.get_swap("2026-06-12", "night")["note"] == "a" * 500 + + def test_swap_omits_blank_note(schedule, seed, quiet_slack): employee = _alice(schedule, seed) seed.override("2026-06-12", "114", "Alice")