File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 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 ()
You can’t perform that action at this time.
0 commit comments