feat: add description field to boards and update related components for onboarding
This commit is contained in:
@@ -6,7 +6,7 @@ from uuid import uuid4
|
||||
import pytest
|
||||
|
||||
from app.schemas.board_onboarding import BoardOnboardingConfirm
|
||||
from app.schemas.boards import BoardCreate
|
||||
from app.schemas.boards import BoardCreate, BoardUpdate
|
||||
|
||||
|
||||
def test_goal_board_requires_objective_and_metrics_when_confirmed() -> None:
|
||||
@@ -18,6 +18,7 @@ def test_goal_board_requires_objective_and_metrics_when_confirmed() -> None:
|
||||
BoardCreate(
|
||||
name="Goal Board",
|
||||
slug="goal",
|
||||
description="Ship onboarding improvements.",
|
||||
gateway_id=uuid4(),
|
||||
board_type="goal",
|
||||
goal_confirmed=True,
|
||||
@@ -26,6 +27,7 @@ def test_goal_board_requires_objective_and_metrics_when_confirmed() -> None:
|
||||
BoardCreate(
|
||||
name="Goal Board",
|
||||
slug="goal",
|
||||
description="Ship onboarding improvements.",
|
||||
gateway_id=uuid4(),
|
||||
board_type="goal",
|
||||
goal_confirmed=True,
|
||||
@@ -36,7 +38,13 @@ def test_goal_board_requires_objective_and_metrics_when_confirmed() -> None:
|
||||
|
||||
def test_goal_board_allows_missing_objective_before_confirmation() -> None:
|
||||
"""Draft goal boards may omit objective/success_metrics before confirmation."""
|
||||
BoardCreate(name="Draft", slug="draft", gateway_id=uuid4(), board_type="goal")
|
||||
BoardCreate(
|
||||
name="Draft",
|
||||
slug="draft",
|
||||
description="Iterate on backlog hygiene.",
|
||||
gateway_id=uuid4(),
|
||||
board_type="goal",
|
||||
)
|
||||
|
||||
|
||||
def test_general_board_allows_missing_objective() -> None:
|
||||
@@ -44,11 +52,30 @@ def test_general_board_allows_missing_objective() -> None:
|
||||
BoardCreate(
|
||||
name="General",
|
||||
slug="general",
|
||||
description="General coordination board.",
|
||||
gateway_id=uuid4(),
|
||||
board_type="general",
|
||||
)
|
||||
|
||||
|
||||
def test_board_create_requires_description() -> None:
|
||||
"""Board creation should reject empty descriptions."""
|
||||
with pytest.raises(ValueError, match="description is required"):
|
||||
BoardCreate(
|
||||
name="Goal Board",
|
||||
slug="goal",
|
||||
description=" ",
|
||||
gateway_id=uuid4(),
|
||||
board_type="goal",
|
||||
)
|
||||
|
||||
|
||||
def test_board_update_rejects_empty_description_patch() -> None:
|
||||
"""Patch payloads should reject blank descriptions."""
|
||||
with pytest.raises(ValueError, match="description is required"):
|
||||
BoardUpdate(description=" ")
|
||||
|
||||
|
||||
def test_onboarding_confirm_requires_goal_fields() -> None:
|
||||
"""Onboarding confirm should enforce goal fields for goal board types."""
|
||||
with pytest.raises(
|
||||
|
||||
Reference in New Issue
Block a user