from grantflow.tests.demo_console_helpers import (
    assert_demo_console_tokens,
    demo_console_body,
)


def test_demo_console_exposes_portfolio_controls():
    body = demo_console_body()
    assert_demo_console_tokens(
        body,
        [
            "commentsFilterStatus",
            "commentsFilterVersionId",
            "grantflow_demo_diff_section",
            "grantflow_demo_strict_preflight",
            "grantflow_demo_portfolio_warning_level",
            "grantflow_demo_portfolio_grounding_risk_level",
            "grantflow_demo_portfolio_finding_status",
            "grantflow_demo_portfolio_finding_severity",
            "grantflow_demo_portfolio_toc_text_risk_level",
            "grantflow_demo_portfolio_mel_risk_level",
            "grantflow_demo_portfolio_sla_hotspot_kind",
            "grantflow_demo_portfolio_sla_hotspot_severity",
            "grantflow_demo_portfolio_sla_min_overdue_hours",
            "grantflow_demo_portfolio_sla_top_limit",
            "grantflow_demo_export_gzip_enabled",
            "grantflow_demo_production_export_mode",
            "grantflow_demo_allow_unsafe_export",
            "generatePreflightAlert",
            "generatePreflightAlertTitle",
            "generatePreflightAlertBody",
            "portfolioBtn",
            "portfolioClearBtn",
            "clearPortfolioToCTextRiskBtn",
            "portfolioWarningLevelFilter",
            "portfolioGroundingRiskLevelFilter",
            "portfolioFindingStatusFilter",
            "portfolioFindingSeverityFilter",
            "portfolioToCTextRiskLevelFilter",
            "portfolioMelRiskLevelFilter",
            "/portfolio/quality",
            "/portfolio/metrics/export",
            "/portfolio/quality/export",
            "/portfolio/review-workflow",
            "/portfolio/review-workflow/export",
            "/portfolio/review-workflow/sla",
            "/portfolio/review-workflow/sla/export",
            "/portfolio/review-workflow/sla/hotspots",
            "/portfolio/review-workflow/sla/hotspots/export",
            "/portfolio/review-workflow/sla/hotspots/trends",
            "/portfolio/review-workflow/sla/hotspots/trends/export",
            "/portfolio/review-workflow/trends",
            "/portfolio/review-workflow/trends/export",
            "/portfolio/review-workflow/sla/trends",
            "/portfolio/review-workflow/sla/trends/export",
            "portfolioMetricsCards",
            "portfolioQualityCards",
            "portfolioReviewWorkflowBtn",
            "portfolioReviewWorkflowSummaryLine",
            "portfolioReviewWorkflowPolicyLine",
            "portfolioReviewWorkflowList",
            "portfolioReviewWorkflowJson",
            "copyPortfolioReviewWorkflowJsonBtn",
            "downloadPortfolioReviewWorkflowJsonBtn",
            "downloadPortfolioReviewWorkflowCsvBtn",
            "exportPortfolioReviewWorkflowJsonBtn",
            "exportPortfolioReviewWorkflowCsvBtn",
            "portfolioReviewWorkflowSlaBtn",
            "portfolioReviewWorkflowSlaSummaryLine",
            "portfolioReviewWorkflowSlaList",
            "portfolioReviewWorkflowSlaJson",
            "portfolioSlaHotspotKindFilter",
            "portfolioSlaHotspotSeverityFilter",
            "portfolioSlaMinOverdueHoursFilter",
            "portfolioSlaTopLimitFilter",
            "portfolioReviewWorkflowSlaHotspotsBtn",
            "portfolioReviewWorkflowSlaHotspotsSummaryLine",
            "portfolioReviewWorkflowSlaHotspotsList",
            "portfolioReviewWorkflowSlaHotspotsJson",
            "portfolioReviewWorkflowSlaHotspotsTrendsBtn",
            "portfolioReviewWorkflowSlaHotspotsTrendsSummaryLine",
            "portfolioReviewWorkflowSlaHotspotsTrendSparkline",
            "portfolioReviewWorkflowSlaHotspotsTrendsList",
            "portfolioReviewWorkflowSlaHotspotsTrendsJson",
            "copyPortfolioReviewWorkflowSlaJsonBtn",
            "downloadPortfolioReviewWorkflowSlaJsonBtn",
            "downloadPortfolioReviewWorkflowSlaCsvBtn",
            "copyPortfolioReviewWorkflowSlaHotspotsJsonBtn",
            "downloadPortfolioReviewWorkflowSlaHotspotsJsonBtn",
            "downloadPortfolioReviewWorkflowSlaHotspotsCsvBtn",
            "copyPortfolioReviewWorkflowSlaHotspotsTrendsJsonBtn",
            "downloadPortfolioReviewWorkflowSlaHotspotsTrendsJsonBtn",
            "downloadPortfolioReviewWorkflowSlaHotspotsTrendsCsvBtn",
            "exportPortfolioReviewWorkflowSlaJsonBtn",
            "exportPortfolioReviewWorkflowSlaCsvBtn",
            "exportPortfolioReviewWorkflowSlaHotspotsJsonBtn",
            "exportPortfolioReviewWorkflowSlaHotspotsCsvBtn",
            "exportPortfolioReviewWorkflowSlaHotspotsTrendsJsonBtn",
            "exportPortfolioReviewWorkflowSlaHotspotsTrendsCsvBtn",
            "portfolioReviewWorkflowTrendsBtn",
            "portfolioReviewWorkflowTrendsSummaryLine",
            "portfolioReviewWorkflowTrendSparkline",
            "portfolioReviewWorkflowTrendsList",
            "portfolioReviewWorkflowTrendsJson",
            "copyPortfolioReviewWorkflowTrendsJsonBtn",
            "downloadPortfolioReviewWorkflowTrendsJsonBtn",
            "downloadPortfolioReviewWorkflowTrendsCsvBtn",
            "exportPortfolioReviewWorkflowTrendsJsonBtn",
            "exportPortfolioReviewWorkflowTrendsCsvBtn",
            "portfolioReviewWorkflowSlaTrendsBtn",
            "portfolioReviewWorkflowSlaTrendsSummaryLine",
            "portfolioReviewWorkflowSlaTrendSparkline",
            "portfolioReviewWorkflowSlaTrendsList",
            "portfolioReviewWorkflowSlaTrendsJson",
            "copyPortfolioReviewWorkflowSlaTrendsJsonBtn",
            "downloadPortfolioReviewWorkflowSlaTrendsJsonBtn",
            "downloadPortfolioReviewWorkflowSlaTrendsCsvBtn",
            "exportPortfolioReviewWorkflowSlaTrendsJsonBtn",
            "exportPortfolioReviewWorkflowSlaTrendsCsvBtn",
            "portfolioMetricsWarningLevelsList",
            "portfolioMetricsGroundingRiskLevelsList",
            "portfolioQualityRiskList",
            "portfolioQualityOpenFindingsList",
            "portfolioQualityWarningLevelsList",
            "portfolioQualityGroundingRiskLevelsList",
            "portfolioQualityCitationTypeCountsList",
            "portfolioQualityArchitectCitationTypeCountsList",
            "portfolioQualityMelCitationTypeCountsList",
            "portfolioQualityMelSummaryList",
            "portfolioQualityFindingStatusList",
            "portfolioQualityFindingSeverityList",
            "portfolioQualityToCTextRiskList",
            "portfolioQualityGroundingRiskList",
            "portfolioQualityGroundedGateSectionsList",
            "portfolioQualityGroundedGateReasonsList",
            "portfolioQualityGroundedGateDonorsList",
            "portfolioQualityPrioritySignalsList",
            "portfolioQualityWeightedDonorsList",
            "% High-warning Jobs",
            "% Medium-warning Jobs",
            "% Low-warning Jobs",
            "% No-warning Jobs",
            "Fallback Dominance",
            "Claim-support Avg",
            "High-Risk Donors",
            "% High ToC-text Risk",
            "ToC Text Issues",
            "% Grounded Gate Block",
            "Grounded Gate Blocks",
            "% Grounded Gate Pass (present)",
            "ToC Text Risk Levels",
            "Clear ToC Risk Filter",
            "portfolioWarningMetaLine",
            "qualityLlmFindingLabelsList",
            "qualityAdvisoryBadgeList",
            "qualityReadinessWarningLevelPill",
            "portfolioQualityLlmLabelCountsList",
            "portfolioQualityTopDonorLlmLabelCountsList",
            "portfolioQualityTopDonorAdvisoryRejectedReasonsList",
            "portfolioQualityTopDonorAdvisoryAppliedList",
            "portfolioQualityFocusedDonorSummaryList",
            "portfolioQualityFocusedDonorAdvisoryPill",
            "portfolioQualityFocusedDonorAdvisoryPillText",
            "portfolioQualityFocusedDonorLlmLabelCountsList",
            "portfolioQualityFocusedDonorAdvisoryRejectedReasonsList",
            "portfolioQualityFocusedDonorAdvisoryAppliedLabelCountsList",
            "portfolioQualityFocusedDonorAdvisoryRejectedLabelCountsList",
            "portfolioQualityAdvisoryAppliedList",
            "portfolioQualityAdvisoryRejectedReasonsList",
            "portfolioQualityJson",
            'params.set("finding_status",',
            'params.set("finding_severity",',
            'params.set("toc_text_risk_level",',
            'params.set("mel_risk_level",',
            "clearPortfolioToCTextRiskFilter",
            "copyPortfolioMetricsJsonBtn",
            "downloadPortfolioMetricsJsonBtn",
            "downloadPortfolioMetricsCsvBtn",
            "exportGzipEnabled",
            "exportInventoryJsonBtn",
            "exportInventoryCsvBtn",
            "exportPortfolioMetricsJsonBtn",
            "exportPortfolioMetricsCsvBtn",
            "exportPortfolioQualityJsonBtn",
            "exportPortfolioQualityCsvBtn",
            "Export (Server-side)",
            'params.set("gzip", "true")',
            "grantflow_portfolio_metrics.csv",
            "copyPortfolioQualityJsonBtn",
            "downloadPortfolioQualityJsonBtn",
            "downloadPortfolioQualityCsvBtn",
            "grantflow_portfolio_quality.csv",
            "portfolioStatusCountsList",
            "portfolioDonorCountsList",
        ],
    )
