from django.urls import reverse


def test_knowledge_base_page_shows_governance_sections(client):
    response = client.get(reverse("platform_ui:knowledge-base"))

    content = response.content.decode("utf-8")
    assert response.status_code == 200
    assert "法规规则包" in content
    assert "RAG 文档源" in content
    assert "RAG 切片" in content
    assert "字段 Schema" in content
    assert "责任人映射" in content
    assert "飞书通知配置" in content


def test_knowledge_base_page_shows_owner_mapping_fields_and_notify_reasons(client):
    response = client.get(reverse("platform_ui:knowledge-base"))

    content = response.content.decode("utf-8")
    assert response.status_code == 200
    assert "owner_role" in content
    assert "owner_name" in content
    assert "department" in content
    assert "chapter_scope" in content
    assert "risk_scope" in content
    assert "feishu_user_id" in content
    assert "feishu_open_id" in content
    assert "feishu_name" in content
    assert "notify_enabled" in content
    assert "task_completed" in content
    assert "task_failed" in content
