2026-02-06 16:12:04 +05:30
|
|
|
from uuid import uuid4
|
2026-02-05 14:40:48 +05:30
|
|
|
|
2026-02-07 00:21:44 +05:30
|
|
|
import pytest
|
|
|
|
|
|
2026-02-06 11:50:14 +05:30
|
|
|
from app.schemas.board_onboarding import BoardOnboardingConfirm
|
2026-02-05 14:40:48 +05:30
|
|
|
from app.schemas.boards import BoardCreate
|
|
|
|
|
|
|
|
|
|
|
2026-02-05 15:00:20 +05:30
|
|
|
def test_goal_board_requires_objective_and_metrics_when_confirmed():
|
2026-02-05 14:40:48 +05:30
|
|
|
with pytest.raises(ValueError):
|
2026-02-05 15:00:20 +05:30
|
|
|
BoardCreate(
|
|
|
|
|
name="Goal Board",
|
|
|
|
|
slug="goal",
|
2026-02-06 16:12:04 +05:30
|
|
|
gateway_id=uuid4(),
|
2026-02-05 15:00:20 +05:30
|
|
|
board_type="goal",
|
|
|
|
|
goal_confirmed=True,
|
|
|
|
|
)
|
2026-02-05 14:40:48 +05:30
|
|
|
|
|
|
|
|
BoardCreate(
|
|
|
|
|
name="Goal Board",
|
|
|
|
|
slug="goal",
|
2026-02-06 16:12:04 +05:30
|
|
|
gateway_id=uuid4(),
|
2026-02-05 14:40:48 +05:30
|
|
|
board_type="goal",
|
2026-02-05 15:00:20 +05:30
|
|
|
goal_confirmed=True,
|
2026-02-05 14:40:48 +05:30
|
|
|
objective="Launch onboarding",
|
|
|
|
|
success_metrics={"emails": 3},
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
2026-02-05 15:00:20 +05:30
|
|
|
def test_goal_board_allows_missing_objective_before_confirmation():
|
2026-02-06 16:12:04 +05:30
|
|
|
BoardCreate(name="Draft", slug="draft", gateway_id=uuid4(), board_type="goal")
|
2026-02-05 15:00:20 +05:30
|
|
|
|
|
|
|
|
|
2026-02-05 14:40:48 +05:30
|
|
|
def test_general_board_allows_missing_objective():
|
2026-02-06 16:12:04 +05:30
|
|
|
BoardCreate(name="General", slug="general", gateway_id=uuid4(), board_type="general")
|
2026-02-06 11:50:14 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_onboarding_confirm_requires_goal_fields():
|
|
|
|
|
with pytest.raises(ValueError):
|
|
|
|
|
BoardOnboardingConfirm(board_type="goal")
|
|
|
|
|
|
|
|
|
|
with pytest.raises(ValueError):
|
|
|
|
|
BoardOnboardingConfirm(board_type="goal", objective="Ship onboarding")
|
|
|
|
|
|
|
|
|
|
with pytest.raises(ValueError):
|
|
|
|
|
BoardOnboardingConfirm(board_type="goal", success_metrics={"emails": 3})
|
|
|
|
|
|
|
|
|
|
BoardOnboardingConfirm(
|
|
|
|
|
board_type="goal",
|
|
|
|
|
objective="Ship onboarding",
|
|
|
|
|
success_metrics={"emails": 3},
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
BoardOnboardingConfirm(board_type="general")
|