from db.collection_landing_push import ensure_magento_hub_shopping_categories


def test_ensure_magento_hub_shopping_categories_dry_run_plans_defaults(catalog_intent_session):
    result = ensure_magento_hub_shopping_categories(
        catalog_intent_session,
        connection_id=2,
        hub_path_slug="Kitchen Cabinets",
        dry_run=True,
    )

    planned = result["planned"]
    assert result["dry_run"] is True
    assert [item["path_slug"] for item in planned] == [
        "kitchen-cabinets",
        "kitchen-cabinets/base-cabinets",
        "kitchen-cabinets/wall-cabinets",
        "kitchen-cabinets/panels-and-fillers",
        "kitchen-cabinets/mouldings",
        "kitchen-cabinets/accessories",
    ]
    assert planned[1]["remote_path"] == "Kitchen Cabinets/Base Cabinets"
