2026-02-05 14:40:48 +05:30
|
|
|
import pytest
|
|
|
|
|
|
|
|
|
|
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",
|
|
|
|
|
board_type="goal",
|
|
|
|
|
goal_confirmed=True,
|
|
|
|
|
)
|
2026-02-05 14:40:48 +05:30
|
|
|
|
|
|
|
|
BoardCreate(
|
|
|
|
|
name="Goal Board",
|
|
|
|
|
slug="goal",
|
|
|
|
|
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():
|
|
|
|
|
BoardCreate(name="Draft", slug="draft", board_type="goal")
|
|
|
|
|
|
|
|
|
|
|
2026-02-05 14:40:48 +05:30
|
|
|
def test_general_board_allows_missing_objective():
|
|
|
|
|
BoardCreate(name="General", slug="general", board_type="general")
|