@@ -57,6 +57,37 @@ def test_revert_pr_title_marks_is_revert(self) -> None:
5757 assert result .is_revert is True
5858
5959
60+ class TestExtractPrDeclined :
61+ def test_pr_declined_fixture_returns_draft_with_lowercased_join_keys (self ) -> None :
62+ # Given
63+ body = _load ("bitbucket_pr_declined.json" )
64+
65+ # When
66+ result = extract_event (
67+ body ,
68+ x_event_key = "pr:declined" ,
69+ x_request_uuid = "req-decl" ,
70+ x_hook_uuid = None ,
71+ )
72+
73+ # Then — declined-PRs share the merged payload shape; the parser
74+ # must persist them with full join keys so they show up in
75+ # downstream rollups (e.g. noergler outcome='declined' joins).
76+ assert isinstance (result , BitbucketEventDraft )
77+ assert result .delivery_id == "req-decl"
78+ assert result .event_type == "pr:declined"
79+ assert result .repo_full_name == "acme/payments-api"
80+ assert result .pr_id == 42
81+ assert result .commit_sha == "abc1234567890abc1234567890abc1234567890a"
82+ assert result .branch_name == "feature/abc-123-retries"
83+ assert result .author == "alice"
84+ assert result .is_revert is False
85+ assert result .change_type == "feature"
86+ assert "ABC-123" in result .jira_keys
87+ assert "PROJ-9" in result .jira_keys
88+ assert result .payload is body
89+
90+
6091class TestExtractRefsChanged :
6192 def test_branch_push_extracts_to_hash_and_branch (self ) -> None :
6293 # Given
0 commit comments