from pathlib import Path

from autoshorts.growth_plan import load_testbatch, validate_testbatch


def test_initial_testbatch_has_three_pillars_with_three_ideas_each():
    batch = load_testbatch(Path("data/drafts/testbatch_001.json"))

    summary = validate_testbatch(batch)

    assert summary["total_ideas"] == 9
    assert summary["pillars"] == {
        "life_optimization": 3,
        "ai_life_systems": 3,
        "faithtok": 3,
    }


def test_initial_testbatch_contains_growth_and_monetization_candidates():
    batch = load_testbatch(Path("data/drafts/testbatch_001.json"))

    summary = validate_testbatch(batch)

    assert summary["duration_buckets"]["growth"] >= 6
    assert summary["duration_buckets"]["tiktok_rewards_candidate"] >= 1


def test_every_idea_has_required_review_fields():
    batch = load_testbatch(Path("data/drafts/testbatch_001.json"))

    summary = validate_testbatch(batch)

    assert summary["missing_fields"] == []
    assert summary["minimum_quality_score"] >= 8
