fix(campaign): align adaptive handbook with shipped UI
This commit is contained in:
@@ -71,15 +71,15 @@ def test_runtime_documentation_reflects_actor_authority_without_exposing_scopes(
|
||||
)[0]
|
||||
|
||||
configuration = topic.metadata["current_configuration"]
|
||||
assert "Create new campaigns." in configuration
|
||||
assert "Build exact recipient messages for review." in configuration
|
||||
assert "Role authorization: Create new campaigns." in configuration
|
||||
assert "Role authorization: Build exact recipient messages for review." in configuration
|
||||
assert not any("queue" in item.lower() for item in configuration)
|
||||
assert not any("campaigns:" in item or "files:" in item or "mail:" in item for item in configuration)
|
||||
|
||||
|
||||
def test_runtime_documentation_requires_both_interface_and_capability() -> None:
|
||||
integration = "mail.campaign_delivery"
|
||||
scopes = {"campaigns:campaign:read", "mail:profile:use"}
|
||||
scopes = {"campaigns:campaign:read", "campaigns:campaign:update", "mail:profile:use"}
|
||||
|
||||
for registry in (
|
||||
_Registry(set(), interface_only={integration}),
|
||||
@@ -88,10 +88,25 @@ def test_runtime_documentation_requires_both_interface_and_capability() -> None:
|
||||
topic = documentation_topics(
|
||||
DocumentationContext(registry=registry, principal=_Principal(frozenset(scopes)), documentation_type="user")
|
||||
)[0]
|
||||
assert not any("selection is available" in item for item in topic.metadata["current_configuration"])
|
||||
assert not any("profile picker" in item for item in topic.metadata["current_configuration"])
|
||||
|
||||
topic = _topics(scopes, {integration})[0]
|
||||
assert any("Mail profile selection is available" in item for item in topic.metadata["current_configuration"])
|
||||
assert any("Mail's actor-filtered profile picker" in item for item in topic.metadata["current_configuration"])
|
||||
|
||||
|
||||
def test_mail_delivery_actions_are_not_presented_without_the_mail_contract() -> None:
|
||||
scopes = {
|
||||
"campaigns:campaign:read",
|
||||
"campaigns:campaign:queue",
|
||||
"campaigns:campaign:send",
|
||||
"campaigns:campaign:retry",
|
||||
}
|
||||
|
||||
without_mail = _topics(scopes)[0]
|
||||
with_mail = _topics(scopes, {"mail.campaign_delivery"})[0]
|
||||
|
||||
assert not any("Queue an eligible" in item for item in without_mail.metadata["current_configuration"])
|
||||
assert any("Queue an eligible" in item for item in with_mail.metadata["current_configuration"])
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -109,7 +124,13 @@ def test_runtime_documentation_requires_both_interface_and_capability() -> None:
|
||||
),
|
||||
(
|
||||
{"addresses.recipient_source"},
|
||||
{"campaigns:campaign:read", "campaigns:recipient:import"},
|
||||
{
|
||||
"campaigns:campaign:read",
|
||||
"campaigns:campaign:update",
|
||||
"campaigns:recipient:read",
|
||||
"campaigns:recipient:write",
|
||||
"campaigns:recipient:import",
|
||||
},
|
||||
"traceable recipient snapshot",
|
||||
),
|
||||
(
|
||||
@@ -147,7 +168,7 @@ def test_runtime_documentation_full_composition_uses_only_user_facing_names() ->
|
||||
)
|
||||
)
|
||||
|
||||
assert "Mail profile selection" in rendered
|
||||
assert "Mail's actor-filtered profile picker" in rendered
|
||||
assert "Managed file versions" in rendered
|
||||
assert "Address records" in rendered
|
||||
assert "In-app notifications" in rendered
|
||||
@@ -210,6 +231,7 @@ def test_campaign_manager_sees_only_authoring_tasks_from_the_static_handbook() -
|
||||
assert "campaigns.workflow.share-campaign" not in visible
|
||||
assert "campaigns.workflow.archive-campaign" not in visible
|
||||
assert "campaigns.workflow.delete-untouched-draft" not in visible
|
||||
assert "campaigns.workflow.create-campaign" not in _visible_static_topics({"campaigns:campaign:create"})
|
||||
|
||||
|
||||
def test_sender_sees_queue_and_send_only_with_the_mail_contract_and_profile_authority() -> None:
|
||||
@@ -273,7 +295,9 @@ def test_report_export_and_lifecycle_tasks_are_independently_permission_gated()
|
||||
exporter = _visible_static_topics(
|
||||
{
|
||||
"campaigns:campaign:read",
|
||||
"campaigns:report:read",
|
||||
"campaigns:report:export",
|
||||
"campaigns:recipient:read",
|
||||
"campaigns:recipient:export",
|
||||
}
|
||||
)
|
||||
@@ -287,7 +311,7 @@ def test_report_export_and_lifecycle_tasks_are_independently_permission_gated()
|
||||
)
|
||||
|
||||
assert "campaigns.workflow.export-delivery-report" in exporter
|
||||
assert "campaigns.workflow.view-delivery-report" not in exporter
|
||||
assert "campaigns.workflow.view-delivery-report" in exporter
|
||||
assert "campaigns.workflow.share-campaign" in custodian
|
||||
assert "campaigns.workflow.archive-campaign" in custodian
|
||||
assert "campaigns.workflow.delete-untouched-draft" in custodian
|
||||
|
||||
Reference in New Issue
Block a user