"""Contract checks for the course-mockup skill guidance."""

from pathlib import Path
import unittest


ROOT = Path(__file__).resolve().parents[1]
SKILL_TEXT = (ROOT / "skills" / "course-mockup" / "SKILL.md").read_text(
    encoding="utf-8"
)


class CourseMockupSkillContractTest(unittest.TestCase):
    def test_faculty_mockups_are_framed_as_editable_suggestions(self):
        self.assertIn("Faculty-Facing Framing", SKILL_TEXT)
        self.assertIn("keep, modify, or replace", SKILL_TEXT)
        self.assertIn("instructor's disciplinary judgment decides", SKILL_TEXT)
        self.assertIn("use MLO alignment as the primary evidence", SKILL_TEXT)
        self.assertIn("Separate suggestions from standards", SKILL_TEXT)

    def test_canvas_native_mockup_delivery_requires_staging_review(self):
        self.assertIn("Delivery Surface", SKILL_TEXT)
        self.assertIn("Canvas-native mockup delivery path", SKILL_TEXT)
        self.assertIn("Preview through the staging skill before any Canvas write", SKILL_TEXT)
        self.assertIn("Mockups", SKILL_TEXT)
        self.assertIn("Suggestions", SKILL_TEXT)
        self.assertIn("`Mockup:` or `Suggestion:`", SKILL_TEXT)

    def test_quiz_mockups_use_review_rationale_structure(self):
        self.assertIn("Quiz Mockup Item Structure", SKILL_TEXT)
        self.assertIn("KEEP", SKILL_TEXT)
        self.assertIn("ADD", SKILL_TEXT)
        self.assertIn("REPLACE", SKILL_TEXT)
        self.assertIn("ASU gold for ADD", SKILL_TEXT)
        self.assertIn("OPTIONAL", SKILL_TEXT)
        self.assertIn("Current question:", SKILL_TEXT)
        self.assertIn("Why keep it?", SKILL_TEXT)
        self.assertIn("Why add this question?", SKILL_TEXT)
        self.assertIn("Why replace it?", SKILL_TEXT)
        self.assertIn("the replacement is optional", SKILL_TEXT)
        self.assertIn("faculty may keep the original", SKILL_TEXT)
        self.assertIn("Suggested Alternative Wording", SKILL_TEXT)
        self.assertIn("Suggested Question", SKILL_TEXT)
        self.assertIn("Suggested Replacement", SKILL_TEXT)
        self.assertIn("Why revise the wording?", SKILL_TEXT)
        self.assertIn("Use this only when the current question is being kept", SKILL_TEXT)
        self.assertIn("Skip this section when **Why add this question?**", SKILL_TEXT)
        self.assertIn("Keep answer choices, correct answers, and feedback", SKILL_TEXT)


if __name__ == "__main__":
    unittest.main()
