Skip to content

Commit 3931c8e

Browse files
SilviaAmAmsvenvandescheur
authored andcommitted
✅ [#348] Update E2E tests
1 parent d6cb24f commit 3931c8e

File tree

4 files changed

+64
-31
lines changed

4 files changed

+64
-31
lines changed

backend/src/openarchiefbeheer/destruction/tests/e2e/features/test_feature_list_create.py

+37-21
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# fmt: off
2-
from unittest.mock import patch
3-
42
from django.test import tag
53

64
from asgiref.sync import sync_to_async
@@ -62,32 +60,46 @@ async def test_zaaktype_filters_on_create_page(self):
6260
@sync_to_async
6361
def create_data():
6462
ZaakFactory.create(
65-
post___expand={"zaaktype": {"identificatie": "ZAAKTYPE-01", "url": "http://catalogue-api.nl/zaaktypen/111-111-111"}},
66-
url="http://catalogue-api.nl/zaaktypen/111-111-111"
63+
post___expand={
64+
"zaaktype": {
65+
"identificatie": "ZAAKTYPE-01",
66+
"omschrijving": "ZAAKTYPE-01",
67+
"versiedatum": "2024-01-01",
68+
"url": "http://catalogue-api.nl/zaaktypen/111-111-111"
69+
}
70+
},
6771
)
6872
ZaakFactory.create(
69-
post___expand={"zaaktype": {"identificatie": "ZAAKTYPE-02", "url": "http://catalogue-api.nl/zaaktypen/222-222-222"}},
70-
url="http://catalogue-api.nl/zaaktypen/222-222-222"
73+
post___expand={
74+
"zaaktype": {
75+
"identificatie": "ZAAKTYPE-02",
76+
"omschrijving": "ZAAKTYPE-02",
77+
"versiedatum": "2024-01-01",
78+
"url": "http://catalogue-api.nl/zaaktypen/222-222-222"
79+
}
80+
},
7181
)
7282
ZaakFactory.create(
73-
post___expand={"zaaktype": {"identificatie": "ZAAKTYPE-03", "url": "http://catalogue-api.nl/zaaktypen/333-333-333"}},
74-
url="http://catalogue-api.nl/zaaktypen/333-333-333"
83+
post___expand={
84+
"zaaktype": {
85+
"identificatie": "ZAAKTYPE-03",
86+
"omschrijving": "ZAAKTYPE-03",
87+
"versiedatum": "2024-01-01",
88+
"url": "http://catalogue-api.nl/zaaktypen/333-333-333"
89+
}
90+
},
7591
)
7692
zaak = ZaakFactory.create(
77-
post___expand={"zaaktype": {"identificatie": "ZAAKTYPE-05", "url": "http://catalogue-api.nl/zaaktypen/555-555-555"}},
78-
url="http://catalogue-api.nl/zaaktypen/555-555-555"
93+
post___expand={
94+
"zaaktype": {
95+
"identificatie": "ZAAKTYPE-05",
96+
"omschrijving": "ZAAKTYPE-05",
97+
"versiedatum": "2024-01-01",
98+
"url": "http://catalogue-api.nl/zaaktypen/555-555-555"
99+
}
100+
},
79101
)
80102
DestructionListItemFactory.create(zaak=zaak)
81-
82-
patcher = patch("openarchiefbeheer.zaken.utils._get_zaaktypen_per_version", return_value={
83-
"ZAAKTYPE-01": ["http://catalogue-api.nl/zaaktypen/111-111-111"],
84-
"ZAAKTYPE-02": ["http://catalogue-api.nl/zaaktypen/222-222-222"],
85-
"ZAAKTYPE-03": ["http://catalogue-api.nl/zaaktypen/333-333-333"],
86-
"ZAAKTYPE-04": ["http://catalogue-api.nl/zaaktypen/444-444-444"], # No zaak with this zaaktype is returned
87-
"ZAAKTYPE-05": ["http://catalogue-api.nl/zaaktypen/555-555-555"], # The zaak with this zaaktype is in a destruction list
88-
})
89-
patcher.start()
90-
self.addCleanup(patcher.stop)
91103

92104
async with browser_page() as page:
93105
await self.given.data_exists(create_data)
@@ -97,4 +109,8 @@ def create_data():
97109

98110
await self.when.user_clicks_button(page, "Vernietigingslijst opstellen")
99111
await self.then.path_should_be(page, "/destruction-lists/create")
100-
await self.then.zaaktype_filters_are(page, ["ZAAKTYPE-01", "ZAAKTYPE-02", "ZAAKTYPE-03"])
112+
await self.then.zaaktype_filters_are(page, [
113+
"ZAAKTYPE-01 (ZAAKTYPE-01)",
114+
"ZAAKTYPE-02 (ZAAKTYPE-02)",
115+
"ZAAKTYPE-03 (ZAAKTYPE-03)"
116+
])

backend/src/openarchiefbeheer/destruction/tests/e2e/features/test_feature_list_process_review.py

+13-5
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,12 @@ def create_data():
8686
post___expand={
8787
"zaaktype": {
8888
"identificatie": "ZAAKTYPE-01",
89+
"omschrijving": "ZAAKTYPE-01",
8990
"url": "http://catalogue-api.nl/zaaktypen/111-111-111",
9091
"selectielijst_procestype": {
9192
"url": "http://selectielijst.nl/api/v1/procestype/1"
92-
}
93+
},
94+
"versiedatum": "2024-01-01"
9395
}
9496
},
9597
)
@@ -98,10 +100,12 @@ def create_data():
98100
post___expand={
99101
"zaaktype": {
100102
"identificatie": "ZAAKTYPE-02",
103+
"omschrijving": "ZAAKTYPE-02",
101104
"url": "http://catalogue-api.nl/zaaktypen/222-222-222",
102105
"selectielijst_procestype": {
103106
"url": "http://selectielijst.nl/api/v1/procestype/1"
104-
}
107+
},
108+
"versiedatum": "2024-01-01"
105109
}
106110
},
107111
)
@@ -111,21 +115,25 @@ def create_data():
111115
post___expand={
112116
"zaaktype": {
113117
"identificatie": "ZAAKTYPE-03",
118+
"omschrijving": "ZAAKTYPE-03",
114119
"url": "http://catalogue-api.nl/zaaktypen/333-333-333",
115120
"selectielijst_procestype": {
116121
"url": "http://selectielijst.nl/api/v1/procestype/1"
117-
}
122+
},
123+
"versiedatum": "2024-01-01"
118124
}
119125
},
120126
)
121127
zaak5 = ZaakFactory.create(
122128
post___expand={
123129
"zaaktype": {
124130
"identificatie": "ZAAKTYPE-05",
131+
"omschrijving": "ZAAKTYPE-03",
125132
"url": "http://catalogue-api.nl/zaaktypen/555-555-555",
126133
"selectielijst_procestype": {
127134
"url": "http://selectielijst.nl/api/v1/procestype/1"
128-
}
135+
},
136+
"versiedatum": "2024-01-01"
129137
}
130138
},
131139
)
@@ -152,4 +160,4 @@ def create_data():
152160
await self.when.user_clicks_button(page, self.destruction_list.name)
153161
await self.then.path_should_be(page, "/destruction-lists/00000000-0000-0000-0000-000000000000")
154162

155-
await self.then.zaaktype_filters_are(page, ["ZAAKTYPE-01"])
163+
await self.then.zaaktype_filters_are(page, ["ZAAKTYPE-01 (ZAAKTYPE-01)"])

backend/src/openarchiefbeheer/destruction/tests/e2e/features/test_feature_list_review.py

+13-5
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,12 @@ def create_data():
165165
post___expand={
166166
"zaaktype": {
167167
"identificatie": "ZAAKTYPE-01",
168+
"omschrijving": "ZAAKTYPE-01",
168169
"url": "http://catalogue-api.nl/zaaktypen/111-111-111",
169170
"selectielijst_procestype": {
170171
"url": "http://selectielijst.nl/api/v1/procestype/1"
171-
}
172+
},
173+
"versiedatum": "2024-01-01"
172174
}
173175
},
174176
)
@@ -177,10 +179,12 @@ def create_data():
177179
post___expand={
178180
"zaaktype": {
179181
"identificatie": "ZAAKTYPE-02",
182+
"omschrijving": "ZAAKTYPE-02",
180183
"url": "http://catalogue-api.nl/zaaktypen/222-222-222",
181184
"selectielijst_procestype": {
182185
"url": "http://selectielijst.nl/api/v1/procestype/1"
183-
}
186+
},
187+
"versiedatum": "2024-01-01"
184188
}
185189
},
186190
)
@@ -190,21 +194,25 @@ def create_data():
190194
post___expand={
191195
"zaaktype": {
192196
"identificatie": "ZAAKTYPE-03",
197+
"omschrijving": "ZAAKTYPE-03",
193198
"url": "http://catalogue-api.nl/zaaktypen/333-333-333",
194199
"selectielijst_procestype": {
195200
"url": "http://selectielijst.nl/api/v1/procestype/1"
196-
}
201+
},
202+
"versiedatum": "2024-01-01"
197203
}
198204
},
199205
)
200206
zaak5 = ZaakFactory.create(
201207
post___expand={
202208
"zaaktype": {
203209
"identificatie": "ZAAKTYPE-05",
210+
"omschrijving": "ZAAKTYPE-05",
204211
"url": "http://catalogue-api.nl/zaaktypen/555-555-555",
205212
"selectielijst_procestype": {
206213
"url": "http://selectielijst.nl/api/v1/procestype/1"
207-
}
214+
},
215+
"versiedatum": "2024-01-01"
208216
}
209217
},
210218
)
@@ -220,4 +228,4 @@ def create_data():
220228
await self.when.user_clicks_button(page, self.destruction_list.name)
221229
await self.then.path_should_be(page, "/destruction-lists/00000000-0000-0000-0000-000000000000/review")
222230

223-
await self.then.zaaktype_filters_are(page, ["ZAAKTYPE-01", "ZAAKTYPE-02"])
231+
await self.then.zaaktype_filters_are(page, ["ZAAKTYPE-01 (ZAAKTYPE-01)", "ZAAKTYPE-02 (ZAAKTYPE-02)"])

backend/src/openarchiefbeheer/zaken/tests/factories.py

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def post(obj, create, extracted, **kwargs):
4747
},
4848
"omschrijving": "Aangifte behandelen",
4949
"identificatie": "ZAAKTYPE-01",
50+
"versiedatum": "2024-01-01",
5051
},
5152
"resultaat": {
5253
"resultaattype": "http://catalogue-api.nl/catalogi/api/v1/resultaattypen/111-111-111",

0 commit comments

Comments
 (0)