-
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
dec3a0d
commit 832f7c7
Showing
2 changed files
with
85 additions
and
9 deletions.
There are no files selected for viewing
61 changes: 61 additions & 0 deletions
61
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,61 @@ | ||
# 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") | ||
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) | ||
|
||
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.page_should_contain_text(page, "John Doe") # Should be assignee | ||
|
||
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.when.user_clicks_button(page, "Home") | ||
|
||
await self.then.path_should_be(page, "/destruction-lists/") | ||
await self.then.page_should_contain_text(page, "Jane Doe") # Should be assignee | ||
|
||
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") | ||
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) | ||
|
||
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.page_should_contain_text(page, "John Doe") # Should be assignee | ||
|
||
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.when.user_clicks_button(page, "Home") | ||
|
||
await self.then.path_should_be(page, "/destruction-lists/") | ||
await self.then.page_should_contain_text(page, "Jane Doe") # Should be assignee |
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