from grantflow.tests.security_openapi_helpers import openapi_spec, schemas


def test_openapi_declares_public_component_schemas():
    spec_schemas = schemas(openapi_spec())

    expected = {
        "JobStatusPublicResponse",
        "JobCitationsPublicResponse",
        "JobExportPayloadPublicResponse",
        "CitationPublicResponse",
        "JobVersionsPublicResponse",
        "DraftVersionPublicResponse",
        "JobDiffPublicResponse",
        "JobEventsPublicResponse",
        "JobEventPublicResponse",
        "JobMetricsPublicResponse",
        "JobQualitySummaryPublicResponse",
        "JobQualityToCTextQualitySummaryPublicResponse",
        "JobCriticPublicResponse",
        "CriticFindingsListPublicResponse",
        "CriticFindingsListFiltersPublicResponse",
        "CriticFindingsListSummaryPublicResponse",
        "CriticFindingsBulkStatusPublicResponse",
        "CriticFindingsBulkStatusFiltersPublicResponse",
        "CriticRuleCheckPublicResponse",
        "CriticFatalFlawPublicResponse",
        "CriticFatalFlawStatusUpdatePublicResponse",
        "JobCommentsPublicResponse",
        "ReviewCommentPublicResponse",
        "JobReviewWorkflowPublicResponse",
        "JobReviewWorkflowTrendsPublicResponse",
        "JobReviewWorkflowTrendPointPublicResponse",
        "JobReviewWorkflowSLAPublicResponse",
        "JobReviewWorkflowSLAHotspotsPublicResponse",
        "JobReviewWorkflowSLAHotspotsFiltersPublicResponse",
        "JobReviewWorkflowSLAHotspotsTrendsPublicResponse",
        "JobReviewWorkflowSLAHotspotsTrendsFiltersPublicResponse",
        "JobReviewWorkflowSLATrendsPublicResponse",
        "JobReviewWorkflowSLATrendPointPublicResponse",
        "JobReviewWorkflowSLAFiltersPublicResponse",
        "JobReviewWorkflowSLAProfilePublicResponse",
        "JobReviewWorkflowSLARecomputePublicResponse",
        "JobReviewWorkflowSLAItemPublicResponse",
        "JobReviewWorkflowFiltersPublicResponse",
        "JobReviewWorkflowSummaryPublicResponse",
        "ReviewWorkflowTimelineEventPublicResponse",
        "PortfolioMetricsPublicResponse",
        "PortfolioQualityPublicResponse",
        "PortfolioReviewWorkflowPublicResponse",
        "PortfolioReviewWorkflowFiltersPublicResponse",
        "PortfolioReviewWorkflowTimelineEventPublicResponse",
        "PortfolioReviewWorkflowSLAPublicResponse",
        "PortfolioReviewWorkflowSLAFiltersPublicResponse",
        "PortfolioReviewWorkflowSLAItemPublicResponse",
        "PortfolioReviewWorkflowSLAHotspotsPublicResponse",
        "PortfolioReviewWorkflowSLAHotspotsFiltersPublicResponse",
        "PortfolioReviewWorkflowSLAHotspotsTrendsPublicResponse",
        "PortfolioReviewWorkflowSLAHotspotsTrendsFiltersPublicResponse",
        "PortfolioReviewWorkflowTrendsPublicResponse",
        "PortfolioReviewWorkflowTrendsFiltersPublicResponse",
        "PortfolioReviewWorkflowSLATrendsPublicResponse",
        "PortfolioReviewWorkflowSLATrendsFiltersPublicResponse",
        "PortfolioQualityWeightedSignalPublicResponse",
        "PortfolioQualityDonorWeightedRiskPublicResponse",
        "PortfolioQualityCriticSummaryPublicResponse",
        "PortfolioQualityCitationSummaryPublicResponse",
        "PortfolioQualityMelSummaryPublicResponse",
        "PortfolioQualityToCTextQualitySummaryPublicResponse",
        "PortfolioMetricsFiltersPublicResponse",
        "HITLPendingListPublicResponse",
        "IngestRecentListPublicResponse",
        "IngestRecentRecordPublicResponse",
        "IngestInventoryPublicResponse",
        "IngestInventoryDocFamilyPublicResponse",
        "GeneratePreflightPublicResponse",
        "GeneratePreflightWarningPublicResponse",
        "GeneratePreflightArchitectClaimsPublicResponse",
        "GeneratePreflightGroundingPolicyPublicResponse",
        "QueueWorkerHeartbeatPublicResponse",
        "QueueWorkerHeartbeatPolicyPublicResponse",
        "QueueWorkerHeartbeatStatusPublicResponse",
    }

    assert expected <= set(spec_schemas)
