-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…iew page)
- Loading branch information
1 parent
55c650d
commit 5e79dbe
Showing
2 changed files
with
83 additions
and
9 deletions.
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
backend/src/openarchiefbeheer/destruction/tests/e2e/issues/test_459_update_reviewer.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# fmt: off | ||
from django.test import tag | ||
|
||
from openarchiefbeheer.utils.tests.e2e import browser_page | ||
from openarchiefbeheer.utils.tests.gherkin import GherkinLikeTestCase | ||
|
||
from ....constants import ListStatus | ||
|
||
|
||
@tag("e2e") | ||
@tag("gh-459") | ||
class Issue459UpdateReviewer(GherkinLikeTestCase): | ||
async def test_scenario_record_manager_updates_reviewer(self): | ||
async with browser_page() as page: | ||
record_manger = await self.given.record_manager_exists() | ||
reviewer1 = await self.given.reviewer_exists(username="reviewer1", first_name="John", last_name="Doe") | ||
reviewer2 = await self.given.reviewer_exists(username="reviewer2", first_name="Jane", last_name="Doe") | ||
|
||
await self.given.assignee_exists(user=record_manger) | ||
assignee_reviewer1 = await self.given.assignee_exists(user=reviewer1) | ||
|
||
destruction_list = await self.given.list_exists(name="Destruction list to update", assignees=[assignee_reviewer1], assignee=assignee_reviewer1.user, status=ListStatus.ready_to_review) | ||
|
||
await self.when.record_manager_logs_in(page) | ||
await self.then.path_should_be(page, "/destruction-lists") | ||
await self.then.list_should_have_assignee(page, destruction_list, reviewer1) | ||
|
||
await self.when.user_clicks_button(page, "Destruction list to update") | ||
await self.when.user_clicks_button(page, "Beoordelaar bewerken") | ||
await self.when.user_fills_form_field(page, "Beoordelaar", "Jane Doe (reviewer2)") | ||
await self.when.user_fills_form_field(page, "Reden", "gh-459") | ||
await self.when.user_clicks_button(page, "Toewijzen") | ||
|
||
await self.then.page_should_contain_text(page, "Destruction list to update") | ||
await self.then.list_should_have_assignee(page, destruction_list, reviewer2) | ||
|
||
async def test_scenario_reviewer_updates_reviewer(self): | ||
async with browser_page() as page: | ||
record_manger = await self.given.record_manager_exists() | ||
reviewer1 = await self.given.reviewer_exists(username="reviewer1", first_name="John", last_name="Doe", post__can_start_destruction=True) | ||
reviewer2 = await self.given.reviewer_exists(username="reviewer2", first_name="Jane", last_name="Doe") | ||
|
||
await self.given.assignee_exists(user=record_manger) | ||
assignee_reviewer1 = await self.given.assignee_exists(user=reviewer1) | ||
|
||
destruction_list = await self.given.list_exists(name="Destruction list to update", assignees=[assignee_reviewer1], assignee=assignee_reviewer1.user, status=ListStatus.ready_to_review) | ||
|
||
await self.when.reviewer_logs_in(page, username="reviewer1") | ||
await self.then.path_should_be(page, "/destruction-lists") | ||
await self.then.list_should_have_assignee(page, destruction_list, reviewer1) | ||
|
||
await self.when.user_clicks_button(page, "Destruction list to update") | ||
await self.when.user_clicks_button(page, "Beoordelaar bewerken") | ||
await self.when.user_fills_form_field(page, "Beoordelaar", "Jane Doe (reviewer2)") | ||
await self.when.user_fills_form_field(page, "Reden", "gh-459") | ||
await self.when.user_clicks_button(page, "Toewijzen") | ||
|
||
await self.then.page_should_contain_text(page, "Destruction list to update") | ||
await self.then.list_should_have_assignee(page, destruction_list, reviewer2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters