Skip to content

Commit 6ab602a

Browse files
committed
✅ [#1789] Add test for status indicator in case list
1 parent 9b0338c commit 6ab602a

File tree

2 files changed

+32
-4
lines changed

2 files changed

+32
-4
lines changed

src/open_inwoner/openzaak/tests/factories.py

+10
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
UserCaseInfoObjectNotification,
1717
UserCaseStatusNotification,
1818
ZaakTypeConfig,
19+
ZaakTypeStatusTypeConfig,
1920
ZaakTypeInformatieObjectTypeConfig,
2021
)
2122

@@ -111,6 +112,15 @@ def from_case_type_info_object_dicts(
111112
return ZaakTypeInformatieObjectTypeConfigFactory(**kwargs)
112113

113114

115+
class ZaakTypeStatusTypeConfigFactory(factory.django.DjangoModelFactory):
116+
zaaktype_config = factory.SubFactory(ZaakTypeConfigFactory)
117+
statustype_url = factory.Faker("url")
118+
omschrijving = factory.Faker("pystr", max_chars=80)
119+
120+
class Meta:
121+
model = ZaakTypeStatusTypeConfig
122+
123+
114124
class UserCaseStatusNotificationFactory(factory.django.DjangoModelFactory):
115125
user = factory.SubFactory(UserFactory)
116126
case_uuid = factory.Faker("uuid4")

src/open_inwoner/openzaak/tests/test_cases.py

+22-4
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,15 @@
1818
from open_inwoner.cms.cases.views.mixins import CaseListMixin
1919
from open_inwoner.utils.test import ClearCachesMixin, paginated_response
2020

21+
from ..constants import StatusIndicators
2122
from ...utils.tests.helpers import AssertRedirectsMixin
22-
from ..models import OpenZaakConfig
23+
from ..models import OpenZaakConfig, ZaakTypeStatusTypeConfig
2324
from ..utils import format_zaak_identificatie
24-
from .factories import ServiceFactory, StatusTranslationFactory
25+
from .factories import (
26+
ServiceFactory,
27+
StatusTranslationFactory,
28+
ZaakTypeStatusTypeConfigFactory,
29+
)
2530
from .shared import CATALOGI_ROOT, ZAKEN_ROOT
2631

2732

@@ -193,6 +198,13 @@ def setUpTestData(cls):
193198
volgnummer=2,
194199
isEindstatus=True,
195200
)
201+
202+
cls.zt_statustype_config1 = ZaakTypeStatusTypeConfigFactory.create(
203+
zaaktype_config__identificatie="ZAAK-2022-0000000001",
204+
statustype_url=cls.status_type1["url"],
205+
status_indicator=StatusIndicators.action_required,
206+
status_indicator_text="U moet documenten toevoegen",
207+
)
196208
# open
197209
cls.zaak1 = generate_oas_component(
198210
"zrc",
@@ -331,7 +343,7 @@ def test_list_open_cases(self, m):
331343
"identificatie": self.zaak2["identificatie"],
332344
"description": self.zaaktype["omschrijving"],
333345
"current_status": self.status_type1["omschrijving"],
334-
"statustype_config": None,
346+
"statustype_config": self.zt_statustype_config1,
335347
},
336348
{
337349
"uuid": self.zaak1["uuid"],
@@ -340,7 +352,7 @@ def test_list_open_cases(self, m):
340352
"identificatie": self.zaak1["identificatie"],
341353
"description": self.zaaktype["omschrijving"],
342354
"current_status": self.status_type1["omschrijving"],
343-
"statustype_config": None,
355+
"statustype_config": self.zt_statustype_config1,
344356
},
345357
],
346358
)
@@ -350,6 +362,12 @@ def test_list_open_cases(self, m):
350362
self.assertNotContains(response, self.zaak_intern["identificatie"])
351363
self.assertNotContains(response, self.zaak_intern["omschrijving"])
352364

365+
zaken_cards = response.html.find_all("div", {"class": "card"})
366+
367+
self.assertEqual(len(zaken_cards), 2)
368+
self.assertTrue("U moet documenten toevoegen" in zaken_cards[0].text)
369+
self.assertTrue("U moet documenten toevoegen" in zaken_cards[1].text)
370+
353371
# check zaken request query parameters
354372
list_zaken_req = [
355373
req

0 commit comments

Comments
 (0)