feat(client): CanonLog.add_quest/has_quest for offer_quest
This commit is contained in:
@@ -46,3 +46,15 @@ func test_set_quest_status_rejects_bad_enum():
|
||||
|
||||
func test_unsupported_schema_version_returns_null():
|
||||
assert_null(CanonLog.from_dict({"schema_version": 2}))
|
||||
|
||||
|
||||
func test_add_quest_appends_active_and_is_idempotent():
|
||||
var log = CanonLog.new()
|
||||
assert_false(log.has_quest("find_the_ledger"))
|
||||
assert_true(log.add_quest("find_the_ledger", "The Missing Ledger", "Find who took it"))
|
||||
assert_true(log.has_quest("find_the_ledger"))
|
||||
assert_eq(log.active_quests.size(), 1)
|
||||
assert_eq(log.active_quests[0].status, "active")
|
||||
# second add is a no-op
|
||||
assert_false(log.add_quest("find_the_ledger", "x", "y"))
|
||||
assert_eq(log.active_quests.size(), 1)
|
||||
|
||||
Reference in New Issue
Block a user