Skip to content

Commit 940f24e

Browse files
florentcfricklerhandwerk
authored andcommitted
test: Add regression test about undoing status change from untriaged
1 parent b02ff4b commit 940f24e

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/webview/tests/test_undo.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
from django.urls import reverse
2+
from playwright.sync_api import Page, expect
3+
from pytest_django.live_server_helper import LiveServer
4+
5+
from shared.models.linkage import CVEDerivationClusterProposal
6+
7+
8+
def test_undo_status_change_from_untriaged(
9+
live_server: LiveServer,
10+
as_staff: Page,
11+
cached_suggestion: CVEDerivationClusterProposal,
12+
no_js: bool,
13+
) -> None:
14+
"""Test undoing a status change from untriaged restores the suggestion to untriaged"""
15+
if not no_js:
16+
as_staff.goto(
17+
live_server.url + reverse("webview:suggestion:untriaged_suggestions")
18+
)
19+
suggestion = as_staff.locator(f"#suggestion-{cached_suggestion.pk}")
20+
accept = suggestion.get_by_role("button", name="Accept")
21+
accept.click()
22+
undo = suggestion.get_by_role("button", name="Undo")
23+
undo.click()
24+
expect(suggestion).to_be_visible()
25+
# We check that we are back to untriaged status from the presence of the Accept button
26+
expect(accept).to_be_visible()

0 commit comments

Comments
 (0)