diff --git a/apps/jobs/tests/integration/test_jobs.py b/apps/jobs/tests/integration/test_jobs.py
index be56cfc..61ecf8d 100644
--- a/apps/jobs/tests/integration/test_jobs.py
+++ b/apps/jobs/tests/integration/test_jobs.py
@@ -126,6 +126,23 @@ class TestCreateAndEdit:
assert "Aili Alihankkija" in detail
assert "Alustava" in detail and "Normaali" in detail
+ def test_choice_lists_are_checkbox_groups(
+ self, employee_client: Client, customer: CustomerModel, unit: ServiceUnitModel
+ ) -> None:
+ html = employee_client.get("/jobs/new/").content.decode()
+ assert "
+{% else %}
{% if widget_type == "checkbox" %}
+{% endif %}
{% endwith %}
diff --git a/tests/browser/test_jobs.py b/tests/browser/test_jobs.py
index 76c49f7..aadd0fe 100644
--- a/tests/browser/test_jobs.py
+++ b/tests/browser/test_jobs.py
@@ -103,7 +103,19 @@ def test_create_job_with_keyboard_and_quick_added_customer(
)
page.fill("#id_name", "Messuosasto")
- page.locator("input[name='service_units']").first.check()
+ # The choice lists are real checkboxes: visible, large enough, toggled with Space.
+ unit_box = page.locator("input[name='service_units']").first
+ box = unit_box.bounding_box()
+ assert box is not None and box["width"] >= 16 and box["height"] >= 16
+ unit_box.focus()
+ page.keyboard.press("Space")
+ assert unit_box.is_checked()
+ member_box = page.get_by_role("group", name="Muut jäsenet").get_by_role(
+ "checkbox", name=admin_user.name
+ )
+ member_box.focus()
+ page.keyboard.press("Space")
+ assert member_box.is_checked()
tag = page.locator("#tag-input")
tag.fill("messut")
tag.press("Enter")
@@ -112,4 +124,6 @@ def test_create_job_with_keyboard_and_quick_added_customer(
page.wait_for_url(f"{live_server.url}/jobs/*/")
job = CustomerJobModel.objects.get(name="Messuosasto")
assert job.customer.name == "Uusi Asiakas Oy"
+ assert list(job.service_unit_links.values_list("service_unit_id", flat=True)) == [unit.pk]
+ assert list(job.member_links.values_list("user_id", flat=True)) == [admin_user.pk]
assert page.get_by_text("messut").count() >= 1