from src.domain.integration_events.command_catalog import (
    APP_COMMANDS,
    CONTROL_PLANE_COMMANDS,
    command_definition,
)


def test_app_and_control_plane_commands_are_separate():
    assert command_definition("content.page.create")["owner"] == "cloud"
    assert command_definition("project.create")["owner"] == "core"
    assert "project.create" not in APP_COMMANDS
    assert "content.page.create" not in CONTROL_PLANE_COMMANDS


def test_high_impact_commands_require_a_user_principal():
    assert command_definition("content.publish")["requires_user_principal"] is True
    assert command_definition("workspace.create")["requires_user_principal"] is True
